Jump to content

Hotkeyset need a little help


 Share

Recommended Posts

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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