grahamwh Posted January 15, 2009 Posted January 15, 2009 (edited) Ok so im making a little script to show and hide a game i play called Quake 3 i got that part working but i need the GUI to show on screen when the games running because you cant alt tab from the game to get to the script So ive been trying to set (WinSetOnTop) to a Hotkey but i just cant get it to work ive tried lots of different ways so was jus hopin some1 could show me how to get it working so i know for the future Heres my code so far expandcollapse popup#include <GUIConstants.au3> #include <Misc.au3> Opt("GUICoordMode", 1) HotKeySet("{f12}", "Setontop") Local $Button_1, $Button_2, $msg $Form2 = GUICreate("Form1", 200, 200, 200, 200) GUISetBkColor(0x000000) $Button_1 = GUICtrlCreateButton("Unhide", 50, 45, 50) $Button_2 = GUICtrlCreateButton("Hide", 50, 75, 50) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 WinSetState("Quake 3: Arena", "", @SW_SHOW) ;Will show Quake3 Case $msg = $Button_2 WinSetState("Quake 3: Arena", "", @SW_HIDE) ; Will hide Quake3 EndSelect WEnd Func Setontop() WinSetOnTop("Form1", "", 1) EndFunc Edited January 15, 2009 by grahamwh
azure Posted January 15, 2009 Posted January 15, 2009 Ok so im making a little script to show and hide a game i play called Quake 3 i got that part working but i need the GUI to show on screen when the games running because you cant alt tab from the game to get to the script So ive been trying to set (WinSetOnTop) to a Hotkey but i just cant get it to work ive tried lots of different ways so was jus hopin some1 could show me how to get it working so i know for the future Heres my code so far expandcollapse popup#include <GUIConstants.au3> #include <Misc.au3> Opt("GUICoordMode", 1) HotKeySet("{f12}", "Setontop") Local $Button_1, $Button_2, $msg $Form2 = GUICreate("Form1", 200, 200, 200, 200) GUISetBkColor(0x000000) $Button_1 = GUICtrlCreateButton("Unhide", 50, 45, 50) $Button_2 = GUICtrlCreateButton("Hide", 50, 75, 50) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 WinSetState("Quake 3: Arena", "", @SW_SHOW);Will show Quake3 Case $msg = $Button_2 WinSetState("Quake 3: Arena", "", @SW_HIDE) ; Will hide Quake3 EndSelect WEnd Func Setontop() WinSetOnTop("Form1", "", 1) EndFunc Quake3 doesn't run in a window. It's a full screen DirectX display. Don't think you can put a normal window on top of it like you're wanting. Maybe spitting GDI+ stuff to the screen?
grahamwh Posted January 15, 2009 Author Posted January 15, 2009 Hi it does work for Quake 3.Screenshothttp://img88.imageshack.us/my.php?image=setontopec0.jpgI tested it by doing sleep(5000) WinSetOnTop("Form1", "", 1)Just wondering how to set it to a hotkey.
Valuater Posted January 16, 2009 Posted January 16, 2009 Maybe... Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("{F9}", "ShowMe") While 1 Sleep(100) WEnd Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Terminate() Exit 0 EndFunc ;==>Terminate Func ShowMe() WinSetOnTop("Form1", "", 1) EndFunc ;==>ShowMe 8)
grahamwh Posted January 16, 2009 Author Posted January 16, 2009 Wow thanks never thought id get this working but its working perfect now thanks for the reply and fixing my script
Valuater Posted January 16, 2009 Posted January 16, 2009 Welcome... and Welcome to the Autoit Forums!!! 8)
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