Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drag dialog without title bar
#1
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
Code:
Copy      Help
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
#2
Code:
Copy      Help
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
#3
@Kevin
Thank you so much, qm is too powerful Smile
#4
@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
Code:
Copy      Help
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
#5
use WM_NCLBUTTONDBLCLK instead

Code:
Copy      Help
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
#6
@Kevin
Thank you so much
#7
Max does not work
I want to toggle the window max and original size by double-clicking
 
Code:
Copy      Help
,case WM_NCLBUTTONDBLCLK ;;max dialog
,max hDlg


Forum Jump:


Users browsing this thread: 1 Guest(s)