Modify

Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#251 closed Bug (Fixed)

GUIRegisterMsg return bug regression

Reported by: Saunders <admin@…> Owned by: Jon
Milestone: 3.2.13.0 Component: AutoIt
Version: 3.2.11.12 Severity: None
Keywords: GUIRegisterMsg return regression Cc:

Description

The example script should be enough, but just to be clear, it appears that a function that returns inside a function that's been registered (via GUIRegisterMsg) makes the registered function ignore the internal message handler. A simple workaround is to Return $GUI_RUNDEFMSG regardless, but it worked fine back in 3.2.11.5 and bugs in 3.2.11.9 (I don't have any versions in between for testing, sorry), I'm putting down the latest version simply because the bug is still present. This may be a duplicate of #222, but I'm not sure.

#include <GUIConstants.au3>
#include <WindowsConstants.au3>

Opt('GUIResizeMode', $GUI_DOCKBORDERS)
$gui = GUICreate(@AutoItVersion, 200, 200, Default, Default, $WS_OVERLAPPEDWINDOW)
GUICtrlCreateEdit('Control should size with window... but it does not.', 0, 0, 200, 200)
GUISetState()

GUIRegisterMsg($WM_SIZE, 'WM_SIZE')

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE


Func WM_SIZE()
	Test()
	;~ Return $GUI_RUNDEFMSG ; Should not be required, but if you uncomment everything works fine.
EndFunc

Func Test()
	Return 1
EndFunc

Attachments (0)

Change History (5)

comment:1 by Jon, 18 years ago

JP, maybe we should go back to the original version of this code. All the fixes we've done have just made things worse?

comment:2 by Valik, 18 years ago

Define "worse". It's all been wrong and will always be wrong until the entire Return mechanic is re-written.

comment:3 by Jon, 18 years ago

Owner: set to Jon
Status: newaccepted

Rewritten this code in a test version. Just checking if it fixes all the bugs and if it's worth the risk of including it in the release at this stage.

comment:4 by Jon, 18 years ago

Milestone: 3.2.11.13
Resolution: Fixed
Status: acceptedclosed

Fixed in version: 3.2.11.13

comment:5 by Valik, 17 years ago

Milestone: 3.2.11.133.2.13.0

Fixing wrong milestone.

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.