Sign in to follow this  
Followers 0
CrewXp

Any way to have an input box overlay a game without the game losing focus?

8 posts in this topic

Hey, is there any way to have an input box overlay a game without the game losing focus?

I have a chat program that about 20 of us use, but we have to exit the game we're playing to use it. (Counter-Strike usually)

Is there any way to have the GUI or inputbox overlay the game, so we can type something in then send it.

..without losing the game's focus, and having the game exit to the desktop?

Thanks.

Share this post


Link to post
Share on other sites



I think you can just use WinSetOnTop ( "your app", "", 1 ). You'll have to give it focus to initiate and use it but after that it should stay on top.

Share this post


Link to post
Share on other sites

Doesn't work. One of the first things I've tried.

It shows in game, but then quickly disappears. And kind of flickers on and off. If you click on it... the game loses focus and exits to desktop.

Here's a test app..

F9 Puts on Top. F10 removes.

HotKeySet("{F9}","test")
HotKeySet("{F10}","test2")

#include <GUIConstants.au3>

;Initialize variables
Global $GUIWidth
Global $GUIHeight

$GUIWidth = 300
$GUIHeight = 250

;Create window
GUICreate("GameGUI", $GUIWidth, $GUIHeight)

;Create an edit box with no text in it
$Edit_1 = GUICtrlCreateEdit("", 10, 10, 280, 190)

;Create an "OK" button
$OK_Btn = GUICtrlCreateButton("OK", 75, 210, 70, 25)

;Create a "CANCEL" button
$Cancel_Btn = GUICtrlCreateButton("Cancel", 165, 210, 70, 25)

;Show window/Make the window visible
GUISetState(@SW_SHOW)

;Loop until:
;- user presses Esc
;- user presses Alt+F4
;- user clicks the close button
While 1
 ;After every loop check if the user clicked something in the GUI window
   $msg = GUIGetMsg()

   Select
   
    ;Check if user clicked on the close button
      Case $msg = $GUI_EVENT_CLOSE
       ;Destroy the GUI including the controls
         GUIDelete()
       ;Exit the script
         Exit
         
    ;Check if user clicked on the "OK" button
      Case $msg = $OK_Btn
         MsgBox(64, "New GUI", "You clicked on the OK button!")
      
    ;Check if user clicked on the "CANCEL" button
      Case $msg = $Cancel_Btn
         MsgBox(64, "New GUI", "You clicked on the Cancel button!")
         
   EndSelect

WEnd

Func test()
    WinSetOnTop("GameGUI","",1)
EndFunc
Func test2()
    WinSetOnTop("GameGUI","",0)
EndFunc
;While 1
;   WEnd

Share this post


Link to post
Share on other sites

I added BitOR($WS_POPUP, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW) below the GUICreate in the test code, but it seems like it does the exact same thing.

When I toggle the GUI to show on top, it flickers on and off, and when I click the flickering GUI Box, the Game loses focus and minimizes to the taskbar.

Share this post


Link to post
Share on other sites

The GUI is now tool-less, it's basically just an inputbox and a button now.

But I still have the same problem.

When I toggle the GUI to show on top, it flickers on and off, and when I click the flickering GUI Box, the Game loses focus and minimizes to the taskbar.

Try it in a game, like Counter-Strike.

Share this post


Link to post
Share on other sites

still no luck. Does anyone know of a way to hook to the game?

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  
Followers 0