Sign in to follow this  
Followers 0
Nothing2Lose

WM_COMMAND vs MsgBox! x-(

7 posts in this topic

Hi,

How can I use both in a single script??? I want to use WM_COMMAND to process message. So all loop in my script must be removed ;):) ... Perhap i have to use "loop message"... Thanks!

Share this post


Link to post
Share on other sites



Nothing2Lose,

Can you please give an example where you fail to do what you want when using WM_COMMAND and MsgBox? At the moment I do not understand your problem - I have used both in the same script without problem, but obviously not in the same way as you! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Ah...

1, I'm using WM_COMMAND... When detecting an error, i show a MsgBox... And... All data in my list box has been cleared ;):P ...

2, I couldn't use GUICtrlCreateMenu (and MenuItem) with WM_COMMAND, so i used menu udf, but i have got an error (i posted in expand menu topic)... o:) o:)

3, More... ;):)

Share this post


Link to post
Share on other sites

Nothing2Lose,

We need code, not just a list of what went wrong! :)

I'm using WM_COMMAND... When detecting an error, i show a MsgBox

If you are using MsgBox WITHIN the WM_COMMAND message handler, could I remind you of the comment in the Help file for GUIRegisterMsg:

"Warning: blocking of running user functions which executes window messages with commands such as "Msgbox()" can lead to unexpected behavior, the return to the system should be as fast as possible !!!"

If you are doing this, then it is unsurprising that you are having problems. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

I read that command, all loop in my script caused unexpected behavior, so i had to remove all loop except MsgBox()... ;):)

Share this post


Link to post
Share on other sites

Nothing2Lose,

For the third, and last, time of asking - please post the code that is giving you the problem. No code = no help! ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Code isn't really needed to offer a suggestion in this situation.

Create a global variable.

Set the initial value to false.

Where you have your MsgBox(), instead mark your global as true ( ready to process ).

In your main loop, check if the global is true.

If global is true, do MsgBox().

After MsgBox() mark global as false again.

I use this method with all of my message blocking functions I need to run when a registered message/callback event is fired.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0