[v2.0.2] postmessage fires onmessage callback twice Topic is solved

Report problems with documented functionality
User avatar
thqby
Posts: 391
Joined: 16 Apr 2021, 11:18
Contact:

[v2.0.2] postmessage fires onmessage callback twice

Post by thqby » 30 Jan 2023, 03:48

Code: Select all

g := Gui()
e := g.AddEdit('w80 h40')
g.Show()
OnMessage(0x0100, ON_WM_KEYDOWN)
ON_WM_KEYDOWN(wParam, lParam, msg, hwnd) {
	OutputDebug wParam ' ' lParam ' ' hwnd '`n'
}
F1:: SendMessage(0x100, 69, 1179649, g.hwnd) ; ON_WM_KEYDOWN is triggered once
F2:: PostMessage(0x100, 69, 1179649, g.hwnd)  ; ON_WM_KEYDOWN is triggered twice
When the above code posts the message using post, the window procedure receives an additional WM_GETDLGCODE message, causing source code g->CalledByIsDialogMessageOrDispatch = false; to be executed.
The executed handler cannot be filtered.


Post Reply

Return to “Bug Reports”