remove frame shadow effect

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jay lee
Posts: 83
Joined: 14 Oct 2021, 11:17

remove frame shadow effect

Post by jay lee » 12 May 2023, 09:26

I used the following code to apply a shadow to my gui and it also makes the corner round, how can I disable this effect in my script or is there a better funtion to have a shadow around the gui?
function:

Code: Select all

FrameShadow(HGui) {																					            	;-- FrameShadow(): Drop Shadow On Borderless Window, (DWM STYLE)

	;--https://autohotkey.com/boards/viewtopic.php?t=29117

	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)
	}
}
RussF
Posts: 1311
Joined: 05 Aug 2021, 06:36

Re: remove frame shadow effect

Post by RussF » 12 May 2023, 09:33

jay lee wrote:how can I disable this effect in my script
Don't call the function.

Russ
jay lee
Posts: 83
Joined: 14 Oct 2021, 11:17

Re: remove frame shadow effect

Post by jay lee » 12 May 2023, 13:43

RussF wrote:
12 May 2023, 09:33
jay lee wrote:how can I disable this effect in my script
Don't call the function.

Russ
No I want to first call the function and then later remove the effect.
m3user
Posts: 235
Joined: 17 Jan 2014, 18:11

Re: remove frame shadow effect

Post by m3user » 13 May 2023, 05:34

What about this?

Code: Select all

FrameShadowReset(HGui){
    DllCall("SetClassLong","UInt",HGui,"Int",-26,"Int",0)
}
Post Reply

Return to “Ask for Help (v1)”