Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog hidden to edge
#8
@kevin
#4 
The hotkey doesn't work. I change the modifier key to Alt, 
In addition, I want to modify the color of the folded dialog box, but there is a small problem. Is there another solution? Thank you in advance

[Image: 1677900600]


Macro Autoshrink2
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80A48 0x0 0 0 224 136 "Dialog" "4"
;3 ActiveX 0x54030000 0x0 0 6 224 110 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;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 ax3SHD
ax3SHD=
;www.quickmacros.com
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sub.DT_AutoShrink hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,;DT_SetAccelerators(hDlg "400 WL[]401 WR[]402 WU[]403 WD[]404 E")
,DT_SetAccelerators(hDlg "400 AL[]401 AR[]402 AU[]403 AD[]404 E")
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 400 ;;vertical line on the left edge of the desktop
,PostMessage hDlg WM_APP 1 0
,case 401 ;;vertical line on the right edge of the desktop
,PostMessage hDlg WM_APP 2 0
,case 402 ;;horizontal line on the Top edge of the desktop
,PostMessage hDlg WM_APP 3 0
,case 403 ;;horizontal line on the Bottom edge of the desktop
,PostMessage hDlg WM_APP 4 0
,case 404 ;;restore window to center screen with no shrink
,PostMessage hDlg WM_APP 0 0
ret 1

#sub DT_AutoShrink
/
function# hDlg message wParam lParam

;Adds simple auto-shrink feature for a dialog.
;The dialog must be a smart dialog, ie with dialog procedure.
;Insert the following statement in the dialog procedure, before 'sel message' line:
;DT_AutoShrink hDlg message wParam lParam

int- shrinkMode
type DASDATA !shr RECT'r int'mode
DASDATA* d=+GetProp(hDlg "qm_das")

sel message
,case WM_INITDIALOG
,SetProp hDlg "qm_das" d._new
,if(shrinkMode<>0)
,,goto shrink
,case WM_DESTROY
,d._delete; RemoveProp hDlg "qm_das"
,case [WM_SETCURSOR,WM_PARENTNOTIFY]
,if(d.shr) goto shrink
,case WM_APP
,shrinkMode=wParam
,goto shrink
,case WM_TIMER
,sel wParam
,,case 1578
,,if(win(mouse)!=hDlg and !GetCapture)
,,,goto shrink
ret

;shrink
RECT r1
d.shr^1
if(d.shr)
,KillTimer hDlg 1578
,GetWindowRect hDlg &d.r
,if(GetWinStyle(hDlg)&WS_CAPTION)
,,SetWinStyle hDlg WS_CAPTION|WS_SYSMENU 2
,,SetWinStyle hDlg WS_EX_TOOLWINDOW 1|4
,sel shrinkMode
,,case 1
,,siz 10 0 hDlg 2
,,r1.left=1; r1.top=0
,,AdjustWindowPos hDlg &r1 3
,,case 2
,,siz 10 0 hDlg 2
,,r1.left=-1; r1.top=0
,,AdjustWindowPos hDlg &r1 3
,,case 3
,,siz 0 10 hDlg 1
,,r1.left=0; r1.top=1
,,AdjustWindowPos hDlg &r1 3
,,case 4
,,siz 0 10 hDlg 1
,,r1.left=0; r1.top=-1
,,AdjustWindowPos hDlg &r1 3
,,case 0
,,SetWinStyle hDlg WS_CAPTION 1
,,siz d.r.right-d.r.left d.r.bottom-d.r.top hDlg
,,r1.left=0; r1.top=0
,,AdjustWindowPos hDlg &r1 3
,DT_SetBackgroundColor hDlg 0 0x00FF00
else
,DT_SetBackgroundColor hDlg 0 0xFFFFFF
,if(GetWinStyle(hDlg)~WS_CAPTION) SetWinStyle(hDlg WS_CAPTION 1)
,,siz d.r.right-d.r.left d.r.bottom-d.r.top hDlg
,,if(shrinkMode=2)
,,,r1.left=-1; r1.top=0
,,,AdjustWindowPos hDlg &r1 2
,,if(shrinkMode=4)
,,,r1.left=0; r1.top=-1
,,,AdjustWindowPos hDlg &r1 3
,,SetTimer hDlg 1578 100 0

Above the IE control in the dialog box, I need to leave a certain height of space to display the color. Is there a good plan?


Messages In This Thread
Dialog hidden to edge - by macman - 02-03-2021, 01:15 AM
RE: Dialog hidden to edge - by redbull2k - 02-03-2021, 02:14 AM
RE: Dialog hidden to edge - by macman - 02-03-2021, 03:17 AM
RE: Dialog hidden to edge - by Kevin - 02-04-2021, 01:02 AM
RE: Dialog hidden to edge - by Kevin - 02-04-2021, 01:51 AM
RE: Dialog hidden to edge - by macman - 02-04-2021, 02:49 AM
RE: Dialog hidden to edge - by macman - 02-04-2021, 09:59 AM
RE: Dialog hidden to edge - by Davider - 03-01-2023, 03:34 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)