How to reduce flickering in Gui Resize?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
pedro45_vs
Posts: 39
Joined: 28 Jun 2020, 18:46

How to reduce flickering in Gui Resize?

Post by pedro45_vs » 05 Sep 2023, 18:10

Is there any method or technique to reduce flickering when resizing a Gui and its controls? I tried Gui.Opt('Ex0x02000000') but it didn't work.
niCode
Posts: 320
Joined: 17 Oct 2022, 22:09

Re: How to reduce flickering in Gui Resize?

Post by niCode » 05 Sep 2023, 19:48

I believe you're looking for Redraw.
pedro45_vs
Posts: 39
Joined: 28 Jun 2020, 18:46

Re: How to reduce flickering in Gui Resize?

Post by pedro45_vs » 06 Sep 2023, 18:18

I already tried that too. In fact, even a simple GUI with just an EditControl flickers when resizing by dragging the window border.
I also tried to insert a small delay in the Gui_Size(GuiObj, MinMax, Width, Height) function, but it still doesn't work.
It's not a problem per se as the script is perfectly functional, it's more of a minor annoyance though and I thought maybe there was some way around this limitation.
User avatar
FanaticGuru
Posts: 1908
Joined: 30 Sep 2013, 22:25

Re: How to reduce flickering in Gui Resize?

Post by FanaticGuru » 06 Sep 2023, 19:39

pedro45_vs wrote:
05 Sep 2023, 18:10
Is there any method or technique to reduce flickering when resizing a Gui and its controls? I tried Gui.Opt('Ex0x02000000') but it didn't work.

Unfortunately, resizing a window in Windows typically causes all kinds of ugliness in the controls that are actually moving and need to be redrawn.

If I drag the bottom-right resize on this window in Edge right now, the right edge and right scroll bar is quite jittery and ugly. Same with Excel or pretty much any other window. Things that actually move and need to be redrawn, happens in little jerky jumps.

+E0x02000000 +E0x00080000 can sometimes help but it is not a cure all. You show Ex0x02000000'. I am not sure if that is valid but that is not the way the documents show it or the way I do it. Docs say + or - E then a hex number. I would do it Gui.Opt('+E0x02000000'). If you have controls on top of other controls, then draw order and buffering can be especially important.

Maybe if you post an actual working example of your GUI code then others can offer advice for improving.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts
AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon
Hotstring Manager - Create and Manage Hotstrings
[Class] WinHook - Create Window Shell Hooks and Window Event Hooks
Post Reply

Return to “Ask for Help (v2)”