Jump to content

[...]In-game gui...


Recommended Posts

Hi. I'd like to know if it's possible to make some gui to popup in a full-screen application or game ?

I tried several ways to do it but nothing have succeed.

The best result I have is the gui windows flashing in my game (like when you got a popup while in game ...)

Is there a way to make the autoit gui on top of the fullscreen application ?

Someone on another forum have pointed GuiRegistermsg to perform this but i'm not sure of how actually I would use it to perform that task.

Any idea ? :)

Thanks

Link to comment
Share on other sites

Look at WinSetOnTop. That will make the window popup on top of any other windows unless that window also has the topmost attribute.

That is exactly the problem...

Speaking of a fullscreen app. or a game, they got the SetonTop attribute.

So trying to give this attribute to my window using WinSetOnTop will flash my gui in-game but the Game seems to have priority and get over my gui in less than 500ms.

So... I would need to do something to "remove" the onTop attribute of the game (or full screen-app) to override it with my gui .

That's what i'm having trouble to figure out how to do it...

Link to comment
Share on other sites

How about starting the game and then changing the workspace dimensions. This example decreases the workspace by 150 pixels on the bottom. You could reduce the workspace by a smaller amount and have a gui toolbar fill the spot.

CODE
;changes workspace dimensions
    Global Const $SPIF_SENDCHANGE = 0x0002
    $Structure = DllStructCreate("int var1; int var2; int var3; int var4")
    DllStructSetData($Structure, "var1", 0)
    DllStructSetData($Structure, "var2", 0)
    DllStructSetData($Structure, "var3", @DesktopWidth)
    DllStructSetData($Structure, "var4", @DesktopHeight-150)
    DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE)

MsgBox(0,"", "Workspace dimensions have been changed - Maximize something")
;change back workspace dimensions

    $Structure = DllStructCreate("int var1; int var2; int var3; int var4")
    DllStructSetData($Structure, "var1", 0)
    DllStructSetData($Structure, "var2", 0)
    DllStructSetData($Structure, "var3", @DesktopWidth)
    DllStructSetData($Structure, "var4", @DesktopHeight)
    DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE)
Link to comment
Share on other sites

Did you try the $WS_EX_TOPMOST style in your GUI?

WinSetOnTop can also remove the topmost attribute. Try WinSetOnTop($hWnd, "", 0) where $hWnd is the handle of the game window.

Tried them both...

CODE
#include <GUIConstants.au3>

#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 633, 452, 193, 125,$WS_BORDER,$WS_EX_TOPMOST)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

HotKeySet("{HOME}","test")

While 1

Sleep(100)

WEnd

Func test()

$win = WinGetHandle("[ACTIVE]")

WinSetOnTop($win,"",0)

EndFunc

Basically, this gui has topmost attribute. If I start a game, it got covered, In-game, pressing home perform the "test" function

that set the game windows ontop attribute to 0, which briefly popup the gui through my game but then got covered again.

I already tried those before without success (code is there if you want to see the result)

Link to comment
Share on other sites

How about starting the game and then changing the workspace dimensions. This example decreases the workspace by 150 pixels on the bottom. You could reduce the workspace by a smaller amount and have a gui toolbar fill the spot.

I tried your code too without success (adapted this way to trigger it in game)

I can clearly see my other monitor workspace modified, but the first one (which is in game) stay unaffected while in game

CODE
Global Const $SPIF_SENDCHANGE = 0x0002

HotKeySet("{HOME}","test")

While 1

Sleep(100)

WEnd

Func test()

$Structure = DllStructCreate("int var1; int var2; int var3; int var4")

DllStructSetData($Structure, "var1", 0)

DllStructSetData($Structure, "var2", 0)

DllStructSetData($Structure, "var3", @DesktopWidth)

DllStructSetData($Structure, "var4", @DesktopHeight-150)

DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE)

Sleep(10000)

$Structure = DllStructCreate("int var1; int var2; int var3; int var4")

DllStructSetData($Structure, "var1", 0)

DllStructSetData($Structure, "var2", 0)

DllStructSetData($Structure, "var3", @DesktopWidth)

DllStructSetData($Structure, "var4", @DesktopHeight)

DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE)

EndFunc

Link to comment
Share on other sites

My thinking about it ...

I'm not sure of it at all but the way I imagine the problem is :

There is some function in windows that set the Game OnTop and make sure it does stay this way while the game windows is active.

I suppose there is probably a way to change the OnTop attribute windows give to this windows...

Autoit WinSetOnTop seems to work for 100 ms (bringing the gui windows on top of the game)

but whenever this is done, the game windows is brought back instantly to top.

So... my supposition is that there is an inbuilt windows hook/function/whatever thing that react to any "parasite"

windows trying to get on the way.

Possibly... Such things could be disabled to enable any "parasite" windows to come on top of the fullscreen app.

I do not have any idea of if my personal theory stand the way or not... but that how I mind mapped the problem.

Link to comment
Share on other sites

hmm. In thinking this through I'm sorry I may have just wasted your time. Because if it doesn't respect the taskbar why should I expect it to respect this script.

Anyways, this script demonstrates more of what I'm thinking.

I'm guessing you could then send a

WinSetState("game title","",@SW_MAXIMIZE)

to the game window, this would cause it to respect the new workspace. Give it a try, couldn't hurt.

CODE
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
Opt("GUIOnEventMode", 1) 
Opt("OnExitFunc", "enditall")
;changes workspace dimensions
    Global Const $SPIF_SENDCHANGE = 0x0002
    $Structure = DllStructCreate("int var1; int var2; int var3; int var4")
    DllStructSetData($Structure, "var1", 0)
    DllStructSetData($Structure, "var2", 35)
    DllStructSetData($Structure, "var3", @DesktopWidth)
    DllStructSetData($Structure, "var4", @DesktopHeight)
    DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE)
         $bar=GUICreate("bar", @DesktopWidth,35,0, 0,$WS_POPUP, $WS_EX_TOOLWINDOW)
        $exit=GUICtrlCreateButton("Exit",5,5,25,25)
        GUICtrlSetOnEvent(-1,"exitit")
        $label=GUICtrlCreateLabel("Perhaps this bar will show",150,5,500,25)
        GUICtrlSetFont(-1,17,400)

GUISetState(@SW_SHOW)
GUISetState(@SW_SHOWNOACTIVATE, -1)
While 1
    sleep(100)
WEnd
Func exitit()
Exit 0
EndFunc

func enditall()
;change back workspace dimensions

    $Structure = DllStructCreate("int var1; int var2; int var3; int var4")
    DllStructSetData($Structure, "var1", 0)
    DllStructSetData($Structure, "var2", 0)
    DllStructSetData($Structure, "var3", @DesktopWidth)
    DllStructSetData($Structure, "var4", @DesktopHeight)
    DllCall("user32.dll", "int", "SystemParametersInfo", "uint", 0x002F, "uint", 0, "ptr", DllStructGetPtr($Structure), "uint", $SPIF_SENDCHANGE)


EndFunc

Link to comment
Share on other sites

hmm. In thinking this through I'm sorry I may have just wasted your time. Because if it doesn't respect the taskbar why should I expect it to respect this script.

I do not mind ... You're bringing ideas on the table :)

Trying to use @SW_Maximize didn't work either...

I tried also to set the game transparent, or use @SW_HIDE without success.

...

And I didn't find anything on the subject anywhere else .

Link to comment
Share on other sites

Do you just need to see your Autoit GUI in the background or do you also need to perform actions in that GUI like pressing buttons ETC...?

I just need to see the gui in the background.

However, if you know a way to show the gui and perform mouse actions, it would be an added bonus.

(But just the gui showing it's nose in my game background would be amazing)

Link to comment
Share on other sites

  • 3 weeks later...

That script will just constantly try to set the window on top and the game will constantly cover it up, therefore making a very annoying flashing gui while playing the game. Since it is a fullscreen game, I think you have very little hope of getting a gui on top of it, but if you do it would be very useful.

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

Hmm have you tried finding the parameters of the gmae, usually the winow size is in their, then manually running the game in a smaller windows size...ehh take away 30px from both (ex 1280,800 =====> 1250,770)

so you wont see a diffrence really BUT the window / game should be taken off set top attribute, since its not tech full screen or in full screen mode (works for 3 games i play)

My UDF:Freeze.au3-Freeze values like CE, ML, ETC[i][/i][u][/u]

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