01-02-2019, 04:43 PM
Function dlg_transparent_with_control
\Dialog_Editor
str dd=
;BEGIN DIALOG
;0 "" 0x90C80A48 0x100 0 0 223 135 "Dialog"
;3 Button 0x54032000 0x0 2 28 48 14 "Button"
;4 Edit 0x54030080 0x200 4 48 96 14 ""
;5 ListBox 0x54230101 0x200 108 34 96 48 ""
;6 Button 0x54031003 0x0 0 0 90 16 "Transparent"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030605 "*" "" "" ""
str controls = "4 5 6"
str e4 lb5 c6Tra
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
,case 6
,,if(but(lParam))
,,,sub.Transparent hDlg 1 lParam
,,else
,,,sub.Transparent hDlg 0
ret 1
#sub Transparent
function hwnd trans [hwndButton]
if(!trans)
,SetWindowRgn hwnd 0 1
,ret
RECT rw rb
GetWindowRect hwndButton &rb
GetWindowRect hwnd &rw
OffsetRect &rb -rw.left -rw.top
int hr=CreateRectRgnIndirect(&rb)
SetWindowRgn hwnd hr 1