Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
keys in dialog
#1
How can I get this?

case ???? ------>out "you pressed key: a"

Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("test" &test)) ret

;BEGIN DIALOG
;0 "" 0x10C80A44 0x100 0 0 223 135 "Form"
;3 Button 0x54032001 0x4 22 36 48 14 "Button1"
;4 Button 0x54032000 0x4 80 36 48 14 "Button2"
;5 Button 0x54032000 0x4 142 36 48 14 "Button3"
;6 Static 0x54000000 0x0 84 62 48 12 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010703 "" ""


ret
;messages
sel message
,case WM_INITDIALOG DT_Init(hDlg lParam); ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,out "boton 1"
,case 4
,out "boton 2"
,case 5
,out "boton 3"
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1
#2
This is not easy because keyboard messages (WM_KEYDOWN and other) are posted to the control that has focus at that time. Dialog procedure does not receive these messages. You would have to install thread-specific hook, which requires one additional function that receives messages.
#3
Ok. Thanks.


Forum Jump:


Users browsing this thread: 1 Guest(s)