Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drag the dialog box client area
#1
Hi,
#1 In the following code, to display the context menu, I must disable drag (line 32), How can I use both?
________________________________________________________________________________________
#2
Also, I want to replace line 32 with a right mouse drag. Is that possible? I've used this feature in a lot of software, For example: Xmind
Note(The final desired effect): 
1.Directly press the right mouse button to display the context menu
2.After pressing the right mouse button (without releasing), drag any area of the dialog box to move the dialog box

Thanks in advance for any advice and help
david

Macro M2
Trigger Aq     Help - how to add the trigger to the macro
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 130 "Dialog" "4"
;3 Edit 0x54030080 0x200 8 8 96 12 ""
;4 Edit 0x54030080 0x200 120 8 96 12 ""
;5 Edit 0x54030080 0x200 8 28 96 13 ""
;6 Edit 0x54030080 0x200 120 28 96 13 ""
;7 Edit 0x54030080 0x200 8 48 96 12 ""
;8 Edit 0x54030080 0x200 120 48 96 12 ""
;9 Edit 0x54030080 0x200 8 68 96 13 ""
;10 Edit 0x54030080 0x200 120 68 96 13 ""
;11 Edit 0x54030080 0x200 8 88 96 12 ""
;12 Edit 0x54030080 0x200 120 88 96 12 ""
;13 Edit 0x54030080 0x200 8 108 96 13 ""
;1 Button 0x54030001 0x4 116 108 48 14 "OK"
;2 Button 0x54030000 0x4 168 108 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""

str controls = "3 4 5 6 7 8 9 10 11 12 13"
str e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,
,case WM_NCHITTEST ret DT_Ret(hDlg HTCAPTION) ;;Use the left mouse button to drag
,
,case WM_CONTEXTMENU ;;Display context menu
,sel ShowMenu("1 mes1[]2 mes2")
,,case 1 mes 1
,,case 2 mes 2
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#2
#1 is solved
Change line 32 to the following code

Code:
Copy      Help
,case [WM_LBUTTONDOWN,WM_LBUTTONUP,WM_MOUSEMOVE,WM_CANCELMODE] DialogDrag hDlg message

about #2
Is it possible to drag a dialog box by pressing the right mouse button over any control?


Forum Jump:


Users browsing this thread: 1 Guest(s)