Jump to content
Sign in to follow this  
grahamwh

Hotkeyset need a little help

Recommended Posts

grahamwh

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

#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 by grahamwh

Share this post


Link to post
Share on other sites
azure

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

#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?

Share this post


Link to post
Share on other sites
Valuater

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites
grahamwh

Wow thanks never thought id get this working but its working perfect now thanks for the reply and fixing my script :)

Share this post


Link to post
Share on other sites
Valuater

Welcome... and Welcome to the Autoit Forums!!!

8)


NEWHeader1.png

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  

×