Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enter button for several different actions
#6
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

Code:
Copy      Help
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


Messages In This Thread

Forum Jump:


Users browsing this thread: 6 Guest(s)