topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 12:27 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Windows Desktop Refresh Message Eater  (Read 7261 times)

Ralf Maximus

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 927
    • View Profile
    • Read more about this member.
    • Donate to Member
IDEA: Windows Desktop Refresh Message Eater
« on: December 01, 2008, 04: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
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Windows Desktop Refresh Message Eater
« Reply #1 on: December 03, 2008, 12:17 PM »
 :) Try Freeze!

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

Skrommel


;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
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: Windows Desktop Refresh Message Eater
« Reply #2 on: December 03, 2008, 01: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
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Windows Desktop Refresh Message Eater
« Reply #3 on: December 03, 2008, 03:19 PM »
 :tellme: Try replacing

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

Skrommel