Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use msctls_hotkey32
#4
Function dialog_hotkey_control
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 msctls_hotkey32 0x54030000 0x200 8 8 96 12 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,;example - set hotkey control data
,int mod=HOTKEYF_ALT|HOTKEYF_CONTROL|HOTKEYF_SHIFT
,int vk='U' ;;or VK_F2 etc
,SendMessage(id(3 hDlg) HKM_SETHOTKEY mod<<8|vk 0)
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,;example - get hotkey control data
,int hk=SendMessage(id(3 hDlg) HKM_GETHOTKEY 0 0)
,out "hotkey: vk=%i, mod=%i" hk&0xff hk>>8&0xff
,
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)