DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: IDEA: Windows Desktop Refresh Message Eater  (Read 9,866 times)

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • Coding Snacks
IDEA: Windows Desktop Refresh Message Eater
« on: December 01, 2008, 10:16 PM »
Here's my issue...

I have an ill-behaved application that I am forced to use, and one of its annoying bugs is that whenever it loads data into its grid, it fires a refresh message at the Windows desktop for EVERY ROW.  So, if I wish to view 1000 records, the Windows desktop goes nuts with refreshing -- icons flicker, child windows redraw.  1000 times in a row.

Needless to say, performance is in the toilet during this time, and I am almost having siezures from my strobing desktop.

Would it be feasible to have a tiny tray applet that, when turned ON, intercepts and disposes of all refresh messages sent to the Windows desktop?  Obviously, if left activated severe cosmetic issues would result... but I anticipate using this hootchie briefly, like only during times when I know my app's grid is going to load records.  So I'd double-click the thingie to disable Windows desktop refresh, then double-click it again to re-enable it.

Any ideas?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: Windows Desktop Refresh Message Eater
« Reply #1 on: December 03, 2008, 06:17 PM »
:) Try Freeze!

Press F1 to freeze/unfreeze the active window (stop it redrawing).

Skrommel


Code
;Freeze.ahk
; Press F1 to freeze/unfreeze the active window (stop it redrawing)
;Skrommel @ 2008

#SingleInstance,Force
OnExit,EXIT
DetectHiddenWindows, on 

F1::
If locked<>1
  Gosub,LOCK
Else
  Gosub,UNLOCK
Return


LOCK:
winid:=WinExist("A")
SendMessage,0xB,0,0,,ahk_id %winid% 
locked=1
Return

UNLOCK:
SendMessage,0xB,1,0,,ahk_id %winid% 
locked=0
DllCall("RedrawWindow",UInt,0,UInt,0,UInt,0,UInt,0x101)
Return

EXIT:
Gosub,UNLOCK
ExitApp

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • Coding Snacks
Re: IDEA: Windows Desktop Refresh Message Eater
« Reply #2 on: December 03, 2008, 07:15 PM »
OOooh, cool!  Thanks, skrommel.

I'll try it and see... but the underlying issue is that the active window is firing refresh event messages at Windows handle=0 (the desktop).  Would freezing the parent window stop it from broadcasting refresh messages?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: IDEA: Windows Desktop Refresh Message Eater
« Reply #3 on: December 03, 2008, 09:19 PM »
:tellme: Try replacing

Code
LOCK:
winid:=WinExist("A")
with
Code
LOCK:
winid:=DllCall("GetDesktopWindow")

Skrommel

Original address: https://www.donationcoder.com/forum/index.php?topic=15977.0