Jump to content
Sign in to follow this  
IanN1990

Disable GUI Updating / Repainting?

Recommended Posts

Hi All,

I have run into a small problem on my latest project. My GUI has a large number of dynamically generated labels, to help with performance i use @SW_Lock / @SW_UNLOCK but i am finding if the GUI loses focus it resumes it repainting / updating.

I tired using GUIRegisterMsg($WM_PAINT, "WM_Paint") but my code is causing an endless loop. Is there like a "skip this paint" i can return?

Func WM_Paint($hWnd, $iMsg, $wParam, $lParam)
        If $Paint = 1 Then
            Return $GUI_RUNDEFMSG
        Else
            Return 0
        EndIf
    EndFunc   ;==>WM_Paint

Update 2. Just found the following;

_SendMessage($hMainGUI, $WM_SETREDRAW, False, 0) ;Disables

_SendMessage($hMainGUI, $WM_SETREDRAW, True, 0) ;Enables
_WinAPI_RedrawWindow($hMainGUI, 0, 0, BitOR( $RDW_FRAME, $RDW_INVALIDATE, $RDW_ALLCHILDREN)) ;Repaints

Though this correctly prevents any repainting, the taskbar icon disappears and makes the GUI becomes click-throughable?

Ian

Edited by IanN1990

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...