Jump to content

Recommended Posts

Posted

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)
GUISetState(@SW_SHOW)
;_WinAPI_SetWindowLong($handle, $GWL_STYLE, $WS_CLIPCHILDREN)
_WinAPI_SetParent($GUI, $handle)
_WinAPI_SetWindowLong($handle, $GWL_STYLE, $WS_CLIPCHILDREN)

;WinSetOnTop($GUI,"",1)
;_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
    Sleep(20)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func UpdateWindow()
    ;WinSetOnTop($GUI,"",1)
    ;GUISetState(@SW_SHOW)
    ;WinSetOnTop($GUI,"",1)
    ;_WinAPI_RedrawWindow ($handle, 0, 0, $RDW_NOINTERNALPAINT)
    _WinAPI_RedrawWindow ($GUI)
    ;_WinAPI_UpdateWindow($GUI)
    ;_WinAPI_ShowWindow($GUI, @SW_SHOW)
    
EndFunc

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

Thanks!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...