Posts: 1,049
Threads: 249
Joined: Jul 2022
09-01-2022, 09:57 PM
(This post was last modified: 09-01-2022, 09:57 PM by Davider.)
Hi,
In the following code, the dialog's title bar is hidden
There is an easy way to achieve drag on the client area?
Thanks in advance for any advice and help
david
Macro
Macro7
str dd=
;BEGIN DIALOG
;0 "" 0x90080AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54231044 0x200 8 8 160 96 ""
;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
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Posts: 1,338
Threads: 61
Joined: Jul 2006
str dd=
;BEGIN DIALOG
;0 "" 0x90080AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54231044 0x200 8 8 160 96 ""
;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
sel message
,case WM_INITDIALOG
,case WM_NCHITTEST ret DT_Ret(hDlg HTCAPTION)
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Posts: 1,049
Threads: 249
Joined: Jul 2022
@
Kevin
Thank you so much, qm is too powerful
Posts: 1,049
Threads: 249
Joined: Jul 2022
@
Kevin
I want to close the window by double-clicking on the client area, but it has no effect
Quote: case WM_LBUTTONDBLCLK ;;close dialog
DT_Cancel hDlg
Macro
Macro2
str dd=
;BEGIN DIALOG
;0 "" 0x90080AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54231044 0x200 8 8 160 96 ""
;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
sel message
,case WM_INITDIALOG
,case WM_NCHITTEST ret DT_Ret(hDlg HTCAPTION)
,case WM_LBUTTONDBLCLK ;;close dialog
,DT_Cancel hDlg
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Posts: 1,338
Threads: 61
Joined: Jul 2006
use WM_NCLBUTTONDBLCLK instead
str dd=
;BEGIN DIALOG
;0 "" 0x90080AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Edit 0x54231044 0x200 8 8 160 96 ""
;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
sel message
,case WM_INITDIALOG
,case WM_NCHITTEST ret DT_Ret(hDlg HTCAPTION)
,case WM_NCLBUTTONDBLCLK;;close dialog"
,DT_Cancel hDlg
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Posts: 1,049
Threads: 249
Joined: Jul 2022
Posts: 1,049
Threads: 249
Joined: Jul 2022
01-04-2023, 12:28 AM
(This post was last modified: 01-04-2023, 12:30 AM by Davider.)
Max does not work
I want to toggle the window max and original size by double-clicking
,case WM_NCLBUTTONDBLCLK ;;max dialog
,max hDlg