Jump to content
Sign in to follow this  

Ingame Redraw

Recommended Posts


I've been trying to get a GUI to show inside a game. I've gotten far enough to make it show, but it flickers like hell.

Here's my example code:

#include <GUIConstants.au3>
#include <WinAPI.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>

$handle = WinGetHandle("SwgClient")
$GUI = GUICreate("Form1", 195, 106, 193, 125)
$Label1 = GUICtrlCreateLabel("Tester", 76, 40, 34, 17)
;_WinAPI_SetWindowLong($handle, $GWL_STYLE, $WS_CLIPCHILDREN)
_WinAPI_SetParent($GUI, $handle)
_WinAPI_SetWindowLong($handle, $GWL_STYLE, $WS_CLIPCHILDREN)

;_WinAPI_SetWindowPos($handle, $HWND_BOTTOM , 195, 106, 193, 125, $SWP_NOZORDER)
_WinAPI_SetWindowPos($GUI, $HWND_TOPMOST, 195, 106, 193, 125, $SWP_NOZORDER)

AdlibEnable("UpdateWindow", 20)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE


Func UpdateWindow()
    ;_WinAPI_RedrawWindow ($handle, 0, 0, $RDW_NOINTERNALPAINT)
    _WinAPI_RedrawWindow ($GUI)
    ;_WinAPI_ShowWindow($GUI, @SW_SHOW)

I've tried everything I can possibly imagine. Has anyone else been able to make something like this work?


Share this post

Link to post
Share on other sites

Try updating your GUI at your screen refresh rate ie. 60 hz (16.66 ms)

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.