Moderators Popular Post Melba23 Posted January 29, 2010 Moderators Popular Post Share Posted January 29, 2010 (edited) Are you annoyed by the limitations of the standard Windows message dialog created by MsgBox? Would you like to have coloured backgrounds and text? To choose the justification and font? Do you want to be able to place the message box other than in the centre of the screen? Centred on your GUI, for example, or at a particular location on screen? What about having user-defined text on as many buttons as you need? And user-defined icons? Or a visible countdown of the timeout? Finally, would you like to choose whether the message box has a button on your already too-crowded taskbar? If the answer to any of these questions is "YES" then the ExtMsgBox UDF is for you! [NEW VERSION] 16 Feb 24 Changed: Some additional functionality added to the "TimeOut" parameter of _ExtMsgBox: - A positive integer sets the EMB timeout as before. - A negative integer will double the size of the countdown timer if it is used. - A colon-delimited string (eg: "10:5") will set the normal EMB timeout (first integer) and will also initially disable the EMB buttons for the required period (second integer). New UDF and examples in the zip. Older version changes: ChangeLog.txt As always, I realise nearly all of the DLL calls in these UDFs could be made by using commands in other UDFs like WinAPI.au3 - but as with all my UDFs (which you can find in my sig below) I am trying to prevent the need for any other include files. The UDF and examples (plus StringSize) in zip format: ExtMsgBox.zip Courteous comments and constructive criticisms welcome - guess which I prefer! M23 Edited February 16 by Melba23 mesale0077, hudsonhock, Exit and 19 others 18 4 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
dmob Posted January 29, 2010 Share Posted January 29, 2010 Wow!!! Outstanding stuff. Marvellous work, Melba... You, Sir, are top notch:graduated: MariusN 1 Link to comment Share on other sites More sharing options...
reb Posted January 30, 2010 Share Posted January 30, 2010 GREAT JOB! I love your work. while playing with your example I found that line 140 should read ConsoleWrite("Test 6 returned: " & $iRetValue & @CRLF) not ConsoleWrite("Test 5 returned: " & $iRetValue & @CRLF) Guess the old copy/paste bug got you. It is nice to download an example and have it go right off the bat. Keep them coming. REB MEASURE TWICE - CUT ONCE Link to comment Share on other sites More sharing options...
rogdog Posted February 8, 2010 Share Posted February 8, 2010 Thanks, great work :-) My Scripts[topic="73325"]_ReverseDNS()[/topic]Favourite scripts by other members[topic="81687"]SNMP udf[/topic][topic="70759"]Using SNMP - MIB protocol[/topic][topic="39050"]_SplitMon:Section off your monitor!, split your monitor into sections for easy management[/topic][topic="73425"]ZIP.au3 UDF in pure AutoIt[/topic][topic="10534"]WMI ScriptOMatic tool for AutoIt[/topic][topic="51103"]Resources UDF embed/use any data/files into/from AutoIt compiled EXE files[/topic] Link to comment Share on other sites More sharing options...
Fire Posted February 9, 2010 Share Posted February 9, 2010 Great Job Melba23 It works Cool.Thank you very-very much. [size="5"] [/size] Link to comment Share on other sites More sharing options...
Mat Posted February 9, 2010 Share Posted February 9, 2010 Great Job Melba23 It works Cool. Thank you very-very much. btw, the forum has an inbuilt way to post members: Melba23 AutoIt Project Listing Link to comment Share on other sites More sharing options...
Fire Posted February 10, 2010 Share Posted February 10, 2010 (edited) Hi to all again. Just wondering about: If i use standart msgbox of Autoit with flag 64 and when it appears i hear "ding" sound. But when i use _ExtMsgBox() and when it appears i didn`t hear somethink like that sound which i say at bottom(i assume "ding" sound) So my question: Is here any other ways to do it somethink like which i mean? I use this way to figure it out: _ExtMsgBox (64 , "Beli|Xeyr|LEGV", "title", $sTestMsg,5) No success:( Only icon changed in MSGBOX and it still silent:( Any hints would be super as always. Thanks in advance. Edited February 10, 2010 by Sh3llC043r [size="5"] [/size] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 10, 2010 Author Moderators Share Posted February 10, 2010 Sh3llC043r,If you want a sound as the ExtMsgBox appears, just add this line into the UDF after the GUI is shown:; Show GUI GUISetState(@SW_SHOW, $hMsgGUI) ; Play sound Soundplay(@WindowsDir & "\Media\Windows Exclamation.wav", 1)From what I can see from my system, the sound should normally only be heard for alert, rather than information or query, message boxes. If you want to match that then you need to use this line:If $iIcon_Style = -2 Or $iIcon_Style = -4 Then Soundplay(@WindowsDir & "\Media\Windows Exclamation.wav", 1)Happy listening! M23 iFFgen 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Fire Posted February 10, 2010 Share Posted February 10, 2010 Yes Melba23 you solve it.Thank you very much.Only one problem in this method is if user OS == from my (which i wrote in eg. my script) it may cause problems.BTW i can use Fileinstall() for Windows Exclamation.wav(renamed in ex:sound64.wav) and use it.You solve my problem THANK YOU VERY-VERY MUCH. You are amazing:huggles: [size="5"] [/size] Link to comment Share on other sites More sharing options...
BrewManNH Posted July 21, 2010 Share Posted July 21, 2010 (edited) Are you annoyed by the limitations of the standard Windows message dialog created by MsgBox? Would you like to have coloured backgrounds and text? To choose the justification and font? Do you want to be able to place the message box other than in the centre of the screen? Centred on your GUI, for example, or at a particular location on screen? What about having user-defined text on up to 6 buttons? And user-defined icons? Finally, would you like to choose whether the message box has a button on your already too-crowded taskbar? If the answer to any of these questions is "YES" then the ExtMsgBox UDF is for you! <snip code out> Once again, I realise nearly all of the DLL calls in these UDFs could be made by using commands in other UDFs like WinAPI.au3 - but as with my Toast UDF (which you can find here) I am trying to prevent the need for any other include files to prevent bloat. If anyone wants the "pretty" versions, just let me know! As always, courteous comments and constructive criticisms welcome - guess which I prefer! All files above in zip format: M23 Edit: Minor code change to example script - see 2 posts below. You might want to update the files that you uploaded in the .zip file. I ran this example script with the 2 #include files contained in the archive and I was getting errors all over the place. When I copied the text from the post rather than downloading it, it worked great. Also, this script requires another function you posted called GetDefaultFont.au3 which isn't shown or included here. I found it by searching for the function name on the forums here and I found it here. Edited July 21, 2010 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 21, 2010 Author Moderators Share Posted July 21, 2010 BrewManNH, Apologies for that - not quite sure what happened there, the zip had an older version of the UDF in it. New zip files uploaded. I hope you liked the UDF after all that! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BrewManNH Posted July 21, 2010 Share Posted July 21, 2010 BrewManNH,Apologies for that - not quite sure what happened there, the zip had an older version of the UDF in it. New zip files uploaded.I hope you liked the UDF after all that! M23No worries, once I figured out what had happened, it all came together and worked great, I will definitely be including this in place of the standard message box when I need to make an impact. Thank you for your work on this. I hope to be able to be able to figure out this language one day. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 21, 2010 Author Moderators Share Posted July 21, 2010 BrewManNH,Glad you like it. By the way, when you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
meisandy Posted July 24, 2010 Share Posted July 24, 2010 Thanks Melba - As always, Great work - as always I hate to say this, but isn't it just a GUI not a Msgbox, what was the point of going to all that trouble when you can use predifined GUI's? But nevertheless, I'm not slaging you off, because I probably will use it some time! Link to comment Share on other sites More sharing options...
KaFu Posted July 24, 2010 Share Posted July 24, 2010 ...but isn't it just a GUI not a Msgbox...Not quite, a GUI is a window. A MsgBox is a predifined GUI with some few options whereas _ExtMsgBox is a predifined GUI with some more options. Utilizing MsgBox a lot you'll soon reach a point where this or that could be done better / different. At that point you'll either code your own GUI... or remember this UDF with a higher degree of freedom ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 24, 2010 Author Moderators Share Posted July 24, 2010 KaFu,Thank you for that. You were very polite....... DjATUit,As KaFu has pointed out, there are a few more user definable options available with this UDF - read the list at the top of the thread to see why you might want to use it in place of a normal MsgBox. But if you feel you must use a standard MsgBox, you might like to look at SmOke_N's MsgBoxUDF here. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
meisandy Posted July 25, 2010 Share Posted July 25, 2010 Thanks for explaining - I just wasn't sure! It's not that I don't like the script/idea, it's just I coudn't see the fact that you could replace about 5 lines with 1! Thanks Link to comment Share on other sites More sharing options...
BrewManNH Posted August 5, 2010 Share Posted August 5, 2010 (edited) I liked the Extended Message Box idea so much that I have added it to the scripts I write now instead of the default message box. I even came up with an interesting addition to it for my own use. I am just learning the AutoIt scripting language, and wanted to try something out using your message box as a base. I added an additional parameter to the function call which I called $Random, what this does is when the user puts any non-zero number in the parameter the ext. msg box function will now change the background color to a random color every ($Random * 1000) milliseconds. I was writing a script that has a message box pop up after copying files to tell the user that it finished, and I wanted to make it have a little more impact and be more noticeable so I threw this twist to your script together. You call the function with this line._ExtMsgBox($Icon, $Button, $Title, $Text, $Timeout, $Pos, $Vpos,$Random) ; Where $Random is any positive number and it causes a delay of this many secondsChange line 188 to this:Func _ExtMsgBox($iIcon, $iButton, $sTitle, $sText, $iTimeout = 0, $hWin = "", $iVPos = 0, $Random = 0)And this is added to the _ExtMsgBox function itself starting at line 406$Timer = TimerInit() While 1 $Delay = TimerDiff($Timer) If $Random > 0 Then $DelayTime = ($Random * 1000) ; Multiply $Random times 1000 for a delay in milliseconds If $Delay > $DelayTime Then GUISetBkColor(Random(1, 32365, 1)) $Timer = TimerInit() EndIf EndIfI'm not sure if anyone else would have a use for this but I thought it was a cool change. Edited August 5, 2010 by BrewManNH If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 5, 2010 Author Moderators Share Posted August 5, 2010 BrewManNH,A nice modification. I hope to be able to be able to figure out this language one dayYou are well on your way! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BrewManNH Posted October 25, 2010 Share Posted October 25, 2010 I have found an issue with this UDF, which is probably caused by the StringSize.au3 UDF that it calls, but I'm not sure of that part. What I have found, and something other users should be aware of, is in my media player I started to incorporate the EMB UDF to make the messages displayed a little more unique. What I found is that after calling an ExtMsgBox function, my media player's controls were getting all messed up. My timer, progress bar, and volume control indicator wouldn't update after. My help menu message boxes were getting the Timer text updates instead of their usual text. I believe it is because StringSize, or the EMB is creating ControlIDs that are causing the media player's control IDs to get changed, so I'm updating the wrong controls after calling this function. I have gotten around the problem by only using it when the playlist is empty, so nothing will be playing afterward, or when I'm exiting the script. I still find this UDF to be a great addition to my toolbox, but there are limitations to using it that I thought others should be aware of. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator 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