ONLY TESTED ON WIN7, Maybe you guys can help me out...
Code: Select all
Gui, +HwndHGui -Caption
FrameShadow(HGui)
Gui, Add, Button, x10 y130 w100 h30, Minimize
Gui, Add, Button, x365 y130 w100 h30, Exit
Gui, Add, GroupBox, x10 y10 w455 h110, GroupBox
Gui, Add, Edit, x20 y30 w435 h80 +Multi, Edit
Gui, Show, Center w475 h166, Frame Shadow Test
Return
ButtonExit:
GuiClose:
ExitApp
ButtonMinimize:
WinMinimize, A
return
FrameShadow(HGui) {
DllCall("dwmapi\DwmIsCompositionEnabled","IntP",_ISENABLED) ; Get if DWM Manager is Enabled
if !_ISENABLED ; if DWM is not enabled, Make Basic Shadow
DllCall("SetClassLong","UInt",HGui,"Int",-26,"Int",DllCall("GetClassLong","UInt",HGui,"Int",-26)|0x20000)
else {
VarSetCapacity(_MARGINS,16)
NumPut(1,&_MARGINS,0,"UInt")
NumPut(1,&_MARGINS,4,"UInt")
NumPut(1,&_MARGINS,8,"UInt")
NumPut(1,&_MARGINS,12,"UInt")
DllCall("dwmapi\DwmSetWindowAttribute", "Ptr", HGui, "UInt", 2, "Int*", 2, "UInt", 4)
DllCall("dwmapi\DwmExtendFrameIntoClientArea", "Ptr", HGui, "Ptr", &_MARGINS)
}
}
WM_LBUTTONDOWN(wParam, lParam, msg, hwnd) {
static init := OnMessage(0x0201, "WM_LBUTTONDOWN")
PostMessage, 0xA1, 2,,, A
}