Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog box defines hotkeys
#5
Not very easy in QM. Need to subclass the control.

Function Dialog249
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54030080 0x200 56 8 96 12 ""
;4 Static 0x54000000 0x0 4 8 48 12 "Middle click"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

str controls = "3"
str e3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

;OutWinMsg message wParam lParam

sel message
,case WM_INITDIALOG
,SetWindowSubclass(id(3 hDlg) &sub.WndProc_Subclass1 1 0)
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1



#sub WndProc_Subclass1
function# hwnd message wParam lParam uIdSubclass dwRefData

;This function can be used with SetWindowSubclass as window procedure.
;<help>SetWindowSubclass</help> is the recommended way to subclass windows. Easier and safer than SetWindowLong. Example: SetWindowSubclass(hwnd &sub.WndProc_Subclass 1 0)


;OutWinMsg message wParam lParam ;;uncomment to see received messages

sel message
,case WM_MBUTTONDOWN
,out "middle down"
,case WM_MBUTTONUP
,out "middle up"

int R=DefSubclassProc(hwnd message wParam lParam)

sel message
,case WM_NCDESTROY
,RemoveWindowSubclass(hwnd &sub.WndProc_Subclass1 uIdSubclass)
,
,;case ...

ret R


Messages In This Thread
Dialog box defines hotkeys - by Davider - 07-21-2022, 10:35 AM
RE: Dialog box defines hotkeys - by Gintaras - 07-21-2022, 11:16 AM
RE: Dialog box defines hotkeys - by Davider - 07-21-2022, 11:23 AM
RE: Dialog box defines hotkeys - by Davider - 08-05-2022, 08:01 AM
RE: Dialog box defines hotkeys - by Gintaras - 08-05-2022, 05:06 PM
RE: Dialog box defines hotkeys - by Davider - 08-05-2022, 06:58 PM
RE: Dialog box defines hotkeys - by Davider - 09-05-2022, 04:58 AM
RE: Dialog box defines hotkeys - by Gintaras - 09-05-2022, 05:27 AM
RE: Dialog box defines hotkeys - by Davider - 09-05-2022, 10:47 AM
RE: Dialog box defines hotkeys - by Gintaras - 09-05-2022, 11:48 AM
RE: Dialog box defines hotkeys - by Davider - 09-05-2022, 10:11 PM

Forum Jump:


Users browsing this thread: 8 Guest(s)