Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clutter Cloak
#1
How can I create a function like http://tomcooke.me.uk/?page_id=5 in QM?
#2
Function dlg_cc
Trigger CSF11     Help - how to add the trigger to the macro
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

int h=win("dlg_cc" "#32770")
if(h) clo h; ret

hDlg=ShowDialog("dlg_cc" &dlg_cc 0 0 1)
opt waitmsg 1
wait 0 WD hDlg

;BEGIN DIALOG
;0 "" 0x80000040 0x8000080 0 0 227 151 "dlg_cc"
;END DIALOG
;DIALOG EDITOR: "" 0x2030006 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,;get rectangles
,int hc=child(mouse); if(!hc) hc=win(mouse)
,RECT rc; GetWindowRect hc &rc
,max hDlg ;;also makes visible
,RECT rd; GetWindowRect hDlg &rd
,RECT ri
,if(!IntersectRect(&ri &rd &rc)) ret
,
,;create hole
,int rw=CreateRectRgn(0 0 rd.right rd.bottom)
,int r2=CreateRectRgn(ri.left ri.top ri.right ri.bottom)
,CombineRgn(rw rw r2 RGN_DIFF)
,SetWindowRgn hDlg rw 1
,DeleteObject r2
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
Thanks.

Can you include % opacity of the hole and to obscure the taskbar too?
#4
opacity: create transparent window in the hole

taskbar: make topmost and use siz and hid- instead of max
#5
opacity: using the function Transparent?
#6
yes
#7
which is the handle of the hole (rw or r2) ?
#8
r2, but it is added to rw and then deleted
#9
,;create hole
,int rw=CreateRectRgn(0 0 rd.right rd.bottom)
,int r2=CreateRectRgn(ri.left ri.top ri.right ri.bottom)
,Transparent(r2 128)
,CombineRgn(rw rw r2 RGN_DIFF)
,SetWindowRgn hDlg rw 1
,DeleteObject r2

doesn't work.
#10
r2 is not window
create your window or dialog
#11
This code works like the program:

Function dlg_cc
Trigger AWF11     Help - how to add the trigger to the macro
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

int h=win("dlg_cc" "#32770")
if(h) clo h; ret

GdiObject- brush=CreateSolidBrush(ColorFromRGB(0 0 0))
hDlg=ShowDialog("dlg_cc" &dlg_cc 0 0 1)
opt waitmsg 1
Transparent(hDlg 220)
wait 0 KF Z;;wait for ESC


;BEGIN DIALOG
;0 "" 0x80000040 0x8000080 0 0 227 151 "dlg_cc"
;END DIALOG
;DIALOG EDITOR: "" 0x2030005 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,;get rectangles
,int hc=child(mouse); if(!hc) hc=win(mouse)
,RECT rc; GetWindowRect hc &rc
,ont hDlg
,max hDlg
,RECT rd; GetWindowRect hDlg &rd
,RECT ri
,if(!IntersectRect(&ri &rd &rc)) ret
,
,;create hole
,int rw=CreateRectRgn(0 0 rd.right rd.bottom)
,int r2=CreateRectRgn(ri.left ri.top ri.right ri.bottom)
,CombineRgn(rw rw r2 RGN_DIFF)
,SetWindowRgn hDlg rw 1
,DeleteObject r2
,case WM_CTLCOLORDLG ret brush
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


Forum Jump:


Users browsing this thread: 2 Guest(s)