NerdFencer Posted April 9, 2009 Share Posted April 9, 2009 (edited) This is a Message Box UDF Lib that can be used as a replacement for MsgBox when you don't want it to halt program executionFunctions_MessageBox_Create_MessageBox_Destroy_MessageBox_SetButtonText_MessageBox_SetButtonTip_MessageBox_SetTimeout_MessageBox_SetWindowIcon_MessageBox_UpdateConstants are also included for almost all return values and flagsInstructions for Basic UsageInclude the file and use _MessageBox_Create just like you would use MsgBoxThe value that it returns is the handle to the message (not a valid handle, just an internal index for the Message Box Construct)When processing the input from your GUI, call _MessageBox_Update(The handle returned from _MessageBox_Create, the return value from GUIGetMsg)this will be default return:-2 if the icon is clicked (box will not be destroyed, only present on some boxes)-1 if the timeout is reached0 if nothing was updated1 if the first button was pressed2 if the seccond button was pressed3 if the third button was pressedIf you want to have the default MsgBox return values from this , call it with the following parameters_MessageBox_Update(The handle returned from _MessageBox_Create, the return value from GUIGetMsg, True)WarningNot all of the more advanced flags from MsgBox are implemented as of yet, use of unsupported flags will make the window look glitchy, but will not do any harm. This will(should) only happen for Modality related flags.I have not yet found where the Icons are stored for the parameters that add icons, so there are temporary replacements instead. These should suffice, but will not look as good. (if you know where they are or happen to find them, please tell me )This has only been tested on Windows XP, so some icons may not be what is expected, and some sounds may not play for other versions of windows (please tell me if this happens)MessageBox.au3 Edited April 9, 2009 by NerdFencer _________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 10, 2009 Share Posted April 10, 2009 (edited) #include <WinAPI.au3> Global Const $IDI_APPLICATION = 32512 Global Const $IDI_HAND = 32513 Global Const $IDI_QUESTION = 32514 Global Const $IDI_EXCLAMATION = 32515 Global Const $IDI_ASTERISK = 32516 Global Const $IDI_WINLOGO = 32517 Global $aIcons[6] = [$IDI_APPLICATION, $IDI_HAND, $IDI_QUESTION, $IDI_EXCLAMATION, $IDI_ASTERISK, $IDI_WINLOGO], $i, $aResult Global $hGUI = GUICreate("Icons", 280, 40) GUISetState() Global $hDC = _WinAPI_GetDC($hGUI) For $i = 0 To 5 $aResult = DllCall("user32.dll", "hwnd", "LoadIcon", "ptr", 0, "long", $aIcons[$i]) _WinAPI_DrawIconEx($hDC, $i * 48 + 4, 4, $aResult[0], 32, 32) Next While GUIGetMsg() <> -3 WEnd Exit Not sure why the $IDI_WINLOGO shows the same as $IDI_APPLICATION on my system but perhaps it's a Vista thing ... Edited April 10, 2009 by WideBoyDixon [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] 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