Jump to content
Sign in to follow this  

Breaking GUIGetMSG()

Recommended Posts


I have a rather big and ugly script in which I am having trouble with GUIGetMsg()

I was going to try and produce example code which doesn't work, but I have failed.

The following works as an example, it spams msgbox all the time, as it should.

$GUIHandle = GUICreate ( "" , 100 , 100)
$button = GUICtrlCreateButton( "Test", 0, 0, 50,50)
GUISetState(@SW_SHOW, $GUIHandle)
$GUIHandle2 = GUICreate ( "" , 100 , 100)
$button2 = GUICtrlCreateButton( "Test", 0, 0, 50,50)
GUISetState(@SW_SHOW, $GUIHandle2)

while 1

Func _DealWithGuiMessages()
    $msg = GUIGetMsg()
    while $msg <> ""
        $msg = GUIGetMsg()

The problem I'm having in my real code is that I can see it enter _DealWithGuiMessages() but it would seem $msg is always "", I'm not seeing any button events or anything else.

I wasn't going to upload it as it's horrible, I'm setting myself up for a flaming, but as I can't replicate the problem I am hoping someone will cast an eye over it spot my stupidity

Well, I guess I'd better mention what the stupid thing does.

The package as a whole is designed to send and receive UDP packets. The GUI runs the UDP_Handler.au3 script, this is to decouple the slow gui from the fast UDP comms. They talk to each other via a shared memory DLL. a temp folder is created with a copy of the DLL in it (this is to allow multiple copies to run).
Launching "Ethernet_Comms(memHandler).au3" presents you with 2 click-able options, these work. If you run 2 copies and select both options, the 2 will talk to each other via UDP on

Once the initial option has been selected, 3 new GUIs are displayed. The small one is the UDP_Handler showing some useless stuff, the other 2 are the Ethernet_Comms showing (a) useless stuff and (b) various elements of the transmitted and received data. There are some buttons on here too, which I'd like to make useful, but I'm getting no GUI messages :( 

{ignore _DealWithGuiMessages2() , it's not in use yet, it will eventually replace _DealWithGuiMessages(), but, well, more debugging first. Also ignore the copious amount of other stuff that isn't called :D }

If anyone can help, even if it's just words of encouragement, I'd be grateful.

I stand ready to take the abuse which I'm sure is bound to follow....



Share this post

Link to post
Share on other sites

As always, I posted too soon, after hours of hair pulling I always find the answer soon after I hit the submit button.....


Opt("GUIOnEventMode", 1)

How did that get in there :D 

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