ProgAndy Posted October 5, 2008 Share Posted October 5, 2008 Some time ago, i found an example in VB on how to chage the names of the Buttons in a MsgBox. Many people want this functionality, so I converted it to AutoIt and here it is: ;### EXAMPLE #include "CustomMsgBox.au3" $REturn = xMsgBox(16+0x200,"Title","Text","Butt 1","The 2nd","The3rd",Default,34,"C:\vista.ico") MsgBox(0, 'ReturnValue:', $REturn)CustomMsgBox.au3 AndrewSchultz 1 *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
ludocus Posted October 5, 2008 Share Posted October 5, 2008 thats funny.. I just made a custom msgbox too... but this is normal msgbox.. nice! Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted October 5, 2008 Share Posted October 5, 2008 (edited) Excellent. Much better than fooling around with other methods. Looks like this method could also be used with others... InputBox, FileOpenDialog, FileSaveDialog, FileSelectFolder ?? Edited October 5, 2008 by mrRevoked Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
ProgAndy Posted October 6, 2008 Author Share Posted October 6, 2008 Well, i think, that's right You just have to know the Control IDs and the change the texts *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Recce Posted March 27, 2009 Share Posted March 27, 2009 (edited) Great job ProgAndy! ;=============================================================================== ; ; Function Name: xMsgBox ; Description:: Shows a Message Box with Cutsom Buttons and Optioinal a custom Icon ; Parameter(s): $lFlagType -> MSgBox Flags ; $sPrompt -> Text ; $sTitle -> Title ; $sButtonText1 -> Button1, "" = default Buttons ; $sButtonText2 -> Button2, "" = only 1 Button, if Button 1 defined ; $sButtonText3 -> Button2, "" = 2 Buttons if Button 1 and 2 defined ; $lLeft -> Left Position of MsgBox ; $lTop -> Top Position of MsgBox ; $sIconPath -> Optional: Path of Icon for MsgBox, Default: Empty ; $hwndThreadOwner -> Optional: Handle of owner window ; ; Requirement(s): v3.2.12.0 or higher ; Return Value(s): If no custom ButtonTexts: default MsgBox ; 1 named Button: Closing and Button = 1 ; 2 named Buttons: Button1 = 6, Button2 = 7 ; 3 named Buttons: Button1 = 6, Button2 = 7, Button3 = 2 ; For 2 and 3 Buttons: Closing MsgBox = 2 (cancel) [ ! 3rd named Button is the same ! ] ; Author(s): Prog@ndy ; ;=============================================================================== Where can I find more help to this code? Edited March 27, 2009 by Recce Link to comment Share on other sites More sharing options...
happy2help Posted August 31, 2009 Share Posted August 31, 2009 HiAre you still working on this??If so, can we have a timeout built in?ie$REturn = xMsgBox(16+0x200,"Title","Text","Butt 1","The 2nd","The3rd",Default,34,"C:\vista.ico",10)would give me a 10 second timeout defaulting to button 1 Link to comment Share on other sites More sharing options...
ProgAndy Posted August 31, 2009 Author Share Posted August 31, 2009 (edited) Hi Are you still working on this?? If so, can we have a timeout built in? ie $REturn = xMsgBox(16+0x200,"Title","Text","Butt 1","The 2nd","The3rd",Default,34,"C:\vista.ico",10) would give me a 10 second timeout defaulting to button 1 No, i do'nt work on this anymore. To add the timeout, simply add $iTimeout = 0 to the parameterlist of the function. Func xMsgBox($lFlagType, _ $sTitle, $sPrompt, _ $sButtonText1 = "" , $sButtonText2 = "" , _ $sButtonText3 = "" , _ $lLeft = 0, $lTop = 0, _ $sIconPath = "", _ $iTimeout = 0, _ $hwndThreadOwner = 0) Then change the following: $xMsgBox = MsgBox($lButtons, $sTitle,$sPrompt,0,$hWndOwner ) ; to $xMsgBox = MsgBox($lButtons, $sTitle,$sPrompt,$iTimeout,$hWndOwner ) Edited August 31, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
MariusN Posted September 26, 2011 Share Posted September 26, 2011 $msg1 = XMSGBOX(64 + 256, "Permissions Restorer", "Set permissions for: ", "Registry", "Folder", "File") "Registry" returns = 6 "Folder" returns = 7 "File" returns = 2 When I press the "x" (close) button, it returns value = 2 (the same as the "File"-button). Is there a way that instead of giving the value of 2, the "x" -button can just straight forward EXIT? (PS: the FILE and CLOSE (x) now have the same return value of 2....and as thus stuffs around my code thx folks Link to comment Share on other sites More sharing options...
ProgAndy Posted September 26, 2011 Author Share Posted September 26, 2011 You will have to modify the code to use AbortRetryIgnore as the buttons which will be changed instead of YesNoCancel for three buttons. This will require some work, and I'm not in the mood do to it Why don't you try the I'll upload a new release, soon. MariusN 1 *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
MariusN Posted September 27, 2011 Share Posted September 27, 2011 thx ProgAndy...shall check it out Link to comment Share on other sites More sharing options...
Laymanball Posted September 27, 2011 Share Posted September 27, 2011 (edited) Error! in code CustomMsgBox.au3 Change.. OnAutoItExitFunction() to OnAutoItExitRegister() For run script sample #include "CustomMsgBox.au3" While 1 $Return = xMsgBox(16+0x200,"Title","Text","Yes","No","Cancel",Default,34,"C:\Program Files\AutoIt3\Icons\au3.ico") MsgBox(0, 'ReturnValue:', 'ID Button = '&$Return) If $Return = 2 Then ExitLoop WEndOR#include "CustomMsgBox.au3" Do $Return = xMsgBox(16+0x200,"Title","Text","Yes","No","Cancel",Default,34,"C:\Program Files\AutoIt3\Icons\au3.ico") MsgBox(0, 'ReturnValue:', 'ID Button = '&$Return) Until $Return = 2 Edited September 27, 2011 by Laymanball MariusN 1 My Sample Script Download: VistaDesktopIconsChangerForXp.au3 (Com,Doc and Bin only) http://www.4shared.com/rar/NMHYL5Igba/VistaDesktopIconsChangerForXp_.html VistaDesktopIconsChangerForXp.exe (Resources) http://www.4shared.com/rar/nzs7Mb1gba/VistaDesktopIconsChangerForXp_.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now