Disabling fade effect on gui animations

Put simple Tips and Tricks that are not entire Tutorials in this forum
User avatar
Klark92
Posts: 161
Joined: 18 Jan 2015, 19:33

Disabling fade effect on gui animations

Post by Klark92 » 04 Feb 2017, 11:17

Code: Select all

; Disable Fading Effect On Guis
DllCall("SystemParametersInfo","UInt",0x1043,"UInt",0,"UInt",0)
Progress, 100, Loading, Please Wait...
Progress, Off
DllCall("SystemParametersInfo","UInt",0x1043,"UInt",0,"UInt",1)
You can put that code top of your script and you dont need to call that again...

It removes bad fade effect on gui when we use Imaged Button Class/imaged buttons/checks/radios/progress bars....

Source : https://autohotkey.com/boards/viewtopic ... 23#p129823

This subject is opened by just me's offer...
Last edited by Klark92 on 10 Feb 2017, 10:22, edited 1 time in total.
Smart Kombo 1.0 | One of the best Knight Online's key combo program...

tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Removing fade effect/animations on all Guis

Post by tmplinshi » 04 Feb 2017, 12:23

Nice. Hide the progress window would be better:

Code: Select all

DisableFadeEffect() {
	; SPI_GETCLIENTAREAANIMATION = 0x1042
	DllCall("SystemParametersInfo", "UInt", 0x1042, "UInt", 0, "UInt*", isEnabled, "UInt", 0)

	if isEnabled {
		; SPI_SETCLIENTAREAANIMATION = 0x1043
		DllCall("SystemParametersInfo", "UInt", 0x1043, "UInt", 0, "UInt", 0, "UInt", 0)
		Progress, 10:P100 Hide
		Progress, 10:Off
		DllCall("SystemParametersInfo", "UInt", 0x1043, "UInt", 0, "UInt", 1, "UInt", 0)
	}
}
Last edited by tmplinshi on 04 Feb 2017, 13:25, edited 2 times in total.

Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Removing fade effect/animations on all Guis

Post by Helgef » 04 Feb 2017, 12:31

I didn't see any effect at all, on win7.
When needed, I do this,

Code: Select all

#SingleInstance, force
Gui, new, +hwndguiId
Dwm_SetWindowAttributeTransistionDisable(guiId,1)
Gui, show, w300 h200
Sleep,2000
Gui,destroy
Exitapp

Dwm_SetWindowAttributeTransistionDisable(hwnd,onOff)
{
	;
	;	DWMWA_TRANSITIONS_FORCEDISABLED=3
	;	Use with DwmSetWindowAttribute. Enables or forcibly disables DWM transitions.
	;	The pvAttribute parameter points to a value of TRUE to disable transitions or FALSE to enable transitions.
	;
	dwAttribute:=3
	cbAttribute:=4
	VarSetCapacity(pvAttribute,4,0)
	NumPut(onOff,pvAttribute,0,"Int")
	hr:=DllCall("Dwmapi.dll\DwmSetWindowAttribute", "Uint", hwnd, "Uint", dwAttribute, "Uint", &pvAttribute, "Uint", cbAttribute)
	return hr
}
This only affects the windows of choise, while
SystemParametersInfo wrote: Retrieves or sets the value of one of the system-wide parameters.
Edit: Maybe I missed the point, is this related specifically to Progress windows?

User avatar
Klark92
Posts: 161
Joined: 18 Jan 2015, 19:33

Re: Removing fade effect/animations on all Guis

Post by Klark92 » 04 Feb 2017, 12:38

@Helgef :

Image

tmplinshi shared this gif before and this fix is for that and similar problem actually :)
Smart Kombo 1.0 | One of the best Knight Online's key combo program...

Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: Removing fade effect/animations on all Guis

Post by Helgef » 04 Feb 2017, 13:28

Ok, looks like I missed the point, sorry. Thanks for sharing :thumbup:

User avatar
Klark92
Posts: 161
Joined: 18 Jan 2015, 19:33

Re: Removing fade effect/animations on all Guis

Post by Klark92 » 04 Feb 2017, 15:11

You're welcome, and thanks tmplinshi for improvemented codes :)
Smart Kombo 1.0 | One of the best Knight Online's key combo program...

Post Reply

Return to “Tips and Tricks (v1)”