Jump to content

Extended Message Box - New Version: 16 Feb 24


Melba23
 Share

Recommended Posts

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. :D

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

  • 2 weeks later...

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

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 by Sh3llC043r
[size="5"] [/size]
Link to comment
Share on other sites

  • Moderators

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! :D

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

  • 5 months later...

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! :blink:

<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! :P

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 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 Gude
How 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

  • Moderators

BrewManNH,

Apologies for that - not quite sure what happened there, the zip had an older version of the UDF in it. :blink: New zip files uploaded.

I hope you liked the UDF after all that! ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

BrewManNH,

Apologies for that - not quite sure what happened there, the zip had an older version of the UDF in it. :blink: New zip files uploaded.

I hope you liked the UDF after all that! :P

M23

No 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 Gude
How 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

  • Moderators

BrewManNH,

Glad you like it. :blink:

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

...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 :blink:...
Link to comment
Share on other sites

  • Moderators

KaFu,

Thank you for that. You were very polite....... :blink:

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. :P

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 weeks later...

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 seconds

Change 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
    EndIf

I'm not sure if anyone else would have a use for this but I thought it was a cool change. :blink:

Edited 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 Gude
How 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

  • Moderators

BrewManNH,

A nice modification. :blink:

I hope to be able to be able to figure out this language one day

You are well on your way! ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 2 months later...

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 Gude
How 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

  • Melba23 changed the title to Extended Message Box - New Version: 16 Feb 24
  • Jon unfeatured this topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...