I tried to use "OnMessage" to detect keypress events on the combo box to execute different code depending on whether a keypress event occurred., But it didn't work. I don't know what went wrong? Is this approach feasible or is there a better way?
Thanks.
Code: Select all
Gui Add, ComboBox, w200 section gMyComboBox HWNDComboBoxHWND vMyComboBox
Gui, Add, Button, ys section HWNDRefreshHWND vRefresh, ↻
Gui Show
return
MyComboBox:
r := OnMessage(0x0100, "KEYDOWN")
if ( r = 1)
GuiControl,, %RefreshHWND%, →
else if ( r = 0 )
Gui, Submit, NoHide
return
KEYDOWN(wParam, lParam, Msg,HWND)
{
Global ComboBoxHWND
if ( HWND = ComboBoxHWND )
return, 1
return, 0
}