Jump to content

In game notification


 Share

Recommended Posts

As of now I am using a sound notification when a user toggles my program on and off while playing a game in full screen. The question is, should I use a pop up window in game or use a sound? I still can not figure out how to get a window to overlay a game that is in full screen mode. XFire has this capability, someone I know says to use WinSetTop() to do it but it wont work because the game is already set to TOPMOST. How is XFIRE doing this then??? Is there something Im missing here?

I just need a message to get displayed while playing a game in full screen, like "Toggled Off" to get displayed somewhere.

If this is not possible then what other alternatives do I have besides playing a sound?

Edited by Toady

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

I think you could use a tool tip.

Ive used a tooltip before, you can see it popup but instantly go away. So I made the tooltip get created 75 times a second (game refresh rate) and it worked... One problem with that, its jerry rigged! The tooltip flickers and Im not sure it will work with every game.

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

I dont remember whoes code this was, but I do know it came from the help section, It searches for a color and then sets the color of the gui to either green if it found it or red if it didnt, Im sure you can modify it so it is red when off and green when on.

#include <GUIConstants.au3>

HotKeySet("{ESC}","_Exit")

Dim $i = PixelSearch(700, 700, 700, 700, 0x000080, 10) ;checks that pixel to make sure it is within 10 shades of a dark blue

$GUI = GUICreate("", 5,5,0,0,$WS_POPUP,$WS_EX_TOOLWINDOW)
GUISetBkColor(0x00FF00)

GUISetState()
;right here have it call the game window up then sleep so it can get fully loaded then it will flash every few seconds in the top corner---------------------------------
;winactivate()
;sleep(time it takes game window to fully load)
WinSetOnTop($GUI,"",1)


AdlibEnable("SwitchColor",800)

While 1
    If GUIGetMsg() = -3 Then
        ExitLoop
    EndIf
WEnd

Func SwitchColor()
    If IsArray($i) Then  ;if the pixel is found within 10 shades of blue, change the gui to green, else change to red
        GUISetBkColor(0x00FF00)
    Else
        GUISetBkColor(0xFF0000)
    EndIf
EndFunc

Func _Exit()
    Exit
EndFunc
Edited by Assault
Link to comment
Share on other sites

Thank you, I will give it a try when I get the chance. It appears that I have to redraw the popup window at the same refreshrate as the game because when the game updates its frame it will draw over the popup window. Im wondering if something like this will work with the code you supplied.

While 1
    If GUIGetMsg() = -3 Then
        ExitLoop
    EndIf
    _API_RedrawWindow($GUI) ;Repaint to make visible in game..
    Sleep(1000/@DesktopRefresh) ;Redisplay at game framerate
WEnd

... am I right? Or is this bogus?

Edited by Toady

www.itoady.com

A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding

Link to comment
Share on other sites

  • 1 year later...

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...