04-21-2011, 03:39 PM
In modeless dialogs, keyboard navigation does not work. Therefore key Enter does not press buttons. To enable Enter only in some conditions, replace the MessageLoop line to
MSG m
rep
,if(GetMessage(&m 0 0 0)<1) break
,int disableKeyboard
,;Add here code to set disableKeyboard to 1 when you need.
,;Or here you can catch WM_KEYDOWN messages and in certain conditions execute your code and continue.
,;example
,if m.message=WM_KEYDOWN and m.wParam=VK_RETURN
,,sel GetWinId(GetFocus)
,,,case 1104 but 1105 hDlg; continue ;;if pressed Enter in the address box, press Go button
,,,;case xxxx but yyyy; continue
,,,;...
,if(!disableKeyboard and IsDialogMessage(GetActiveWindow &m)) continue
,TranslateMessage &m
,DispatchMessage &m