Szhlopp Posted September 8, 2008 Share Posted September 8, 2008 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: expandcollapse popup#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! RegEx/RegExRep Tester!Nerd Olympics - Community App!Login UDFMemory UDF - "Game.exe+753EC" - CE pointer to AU3Password Manager W/ SourceDataFiler - Include files in your au3!--- Was I helpful? Click the little green '+' Link to comment Share on other sites More sharing options...
PartyPooper Posted September 9, 2008 Share Posted September 9, 2008 Try updating your GUI at your screen refresh rate ie. 60 hz (16.66 ms) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now