Sign in to follow this  
Followers 0
Schoening

Problem Running in FullScreen.

3 posts in this topic

#1 ·  Posted (edited)

I am Pretty Happy for my script so far :)

It works as Intended.

HotKeySet("f", "Poof")         ;Triggers xxx
HotKeySet("d", "Poof2")                ;Triggers xxx

MsgBox(0, "Running", "Running") ;MessageBox Informing that the Script is Running

While 1
Sleep(100)
WEnd

Func Poof2()                               ;When User Presses  D   Do:
Send("q")
MouseClick("left")
Send("{tab}")
Sleep(10)
EndFunc

Func Poof()                 ;When User Presses  F   Do:

Send("w")
MouseClick("left")
Send("{tab}")
Sleep(10)
Send("w")
MouseClick("left")
Send("{tab}")
Sleep(10)
Send("w")
MouseClick("left")
Send("{tab}")
Sleep(10)
Send("w")
MouseClick("left")
Send("{tab}")
Sleep(10)
Send("w")
MouseClick("left")
Send("{tab}")
Sleep(10)
Send("1")

EndFunc

But Not in FullScreen !

It Simply Does Not Work in the Application it is supposed to Run in, when i Run the Application in Fullscreen !

Why? I don't get it at all!

Ive Beed Adviced to use

ControlSend()

So i did !

And.. Nothing!

ControlSend("Application", "", "", "{tab}")
Works like Send (In Windowed, But not FullScreen)

Send("w")
MouseClick("left")

I Got Mouseclick to work 50%

ControlClick("Application", "", "" "right", 1)

But To Work 100% The Mouseclick has to Occur at the Current Location of the Arrow, Not in the Center of the window. But It appears that ControlClick only is Capable of "Clicking" in a Set X, Y Position.

So that can't be the right Command.. Perhaps Some form of Advanced ControlSend String?

BUT AGAIN ! WORKS ONLY IN WINDOWED MODE !

The Last one is Simple..

ControlSend("Application", "", "", "d")
"d" Is not the Correct Syntax.. Again.. I Would think this can be done by a Advanced ControlSend string.

But Then Again.. Why Is Send AND ControlSend Not Working for me in FullScreen?

Bonus Info: I Used AutoIt Window Info While the "Application" was in Windowed Mode, So i am fairly shure that i got the Name Right

(It Works in Windowed Mode - Why Should the Name be Diffrent in FullScreen?)

OK ! Here Is How i got it to work

I Compiled it and

!!! Run As Administrator !

Sorry Guys ! ;) Beginner Fail :) (My Third Day with Programming)

It's Somewhat Tagged, So hope this will at least help other Newbies :D

Edited by Schoening

Share this post


Link to post
Share on other sites



ControlClick is used to click on a control, not at some random spot on the screen. You need to use MouseClick with the X and Y of where you want it to click. If it's not clicking, it's possible the program doesn't support automation.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
OK I MIGHT HAVE THE PROBLEM!! GIVE ME A MINUTE :)

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

  • Similar Content

    • Darknightx37
      By Darknightx37
      Hay there i try to create a gui and delete them on my secound monitore when i was in a fullscreen application but i noticed that i got tabed out of the application every time i created a new gui
      how to fix that i get tabed out i already tryed with winsetontop("application", "", 1)
      thx
       
      --> @SW_SHOWNOACTIVATE
      sry im stupid
    • ManneMoses
      By ManneMoses
      Hey there,
      Probably you know about the many questions on this forum, how to disable Ctrl-Alt-Del. I searched the whole forum bot there was not only one answer that worked. But now i found a way on my own hot to prevent that. And btw I have to say that this if f*cking easy, so shame on you  You can try it, it works sure on windows 7 and vista. I also included a hotkey function to exit, but it takes up to 10 seconds until you can access the ctrl alt del screen again. Please tell me if you found out a better way and tell me what is your meaning about my script. Thank you
      -snip-
      Edit: This is the hard way, and i just wanted to show how it could be done. I am confused, no one before me mentioned this script
    • Valiante
      By Valiante
      Hi,
      I've searched but can only find posts from people with the opposite problem (asking how to get their GUI to display on top of a full-screen app, usually a game.
      I've created a toolbar which I use in a work environment, creating the GUI with the following styles;
      $hwnd = GUICreate($title, $toolbarWidth, $height, $left, $top, $WS_POPUPWINDOW, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))   I want it to have a TOPMOST style as it's supposed to behave like the Windows taskbar (which it does in all but one scenario).   If I start a full-screen RDP session, I can still see my toolbar and have to close it.  Is there a way I can make it appear on top of all windows *except* full-screen apps (in the same way the taskbar allows full-screen apps on top of it)?   Thanks in advance.   Val.
    • ludocus
      By ludocus
      Dear all,
      I'm creating this program where the goal is to automate some mouse -click and dragging on an external application.
      Now the problem is, this external application is blocking every automate mouse moves, clicks or anything related to using the mouse.
      So I figured autoit uses postmessage and user32.dll to move the mouse and that this application blocks these attempts.
      Now I'm wondering if there's a different way to move the mouse so it'll go undetected by this external app.
      Any other suggestions are welcome to.
      Thnx in advance
    • momar33
      By momar33
      I am seeing a buttons position change when the following happens.
      1. GUI created at 800 x 600
      2. GUI info is stored using WinGetPos
      3. GUI changed to full-screen using WinMove
      4. Button info is stored using ControlGetPos
      5. Button is deleted
      6. Button is re-created using the stored data from item 4.
      7. GUI is restored to the info gathered in item 2.
      The button starts with this info:
      Button Left:   408 Button Top:    84 Button Width:  80 Button Height: 24   and after the events above the button has this info: Button Left:   409 Button Top:    83 Button Width:  80 Button Height: 24   Here is some code that can reproduce the issue: (press space, f, space, f, then look in the console) #Region Includes #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <Array.au3> #EndRegion Includes Const $HT_KEY_FULLSCREEN = "f" Const $HT_KEY_SPACE = "{SPACE}" Global $btnAddRebuy[21] Global $btnRemovePlayer[21] Global $fFullscreen = False Global $aGuiInfo Global $aGuiInfo2 Global $guiWidth = 800 Global $guiHeight = 600 #Region Dimensions for Settings Screen ; Player Global $lblPlayerTop = 60 Global $playerLabelSpace = 24 ; Add Rebuy Button Global $btnRebuyLeft = 320 Global $btnRebuyWidth = 80 Global $btnRebuyHeight = 24 ; Remove Player Global $btnRemoveLeft = 408 Global $btnRemoveWidth = 80 Global $btnRemoveHeight = 24 #EndRegion Dimensions for Settings Screen $hMain = GUICreate("Timer", $guiWidth, $guiHeight, -1, -1, BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS)) For $i = 1 To 5 Step 1 $btnAddRebuy[$i] = GUICtrlCreateButton("Button", $btnRebuyLeft, $lblPlayerTop + ($playerLabelSpace * $i), $btnRebuyWidth, $btnRebuyHeight) GUICtrlSetResizing($btnAddRebuy[$i], $GUI_DOCKAUTO) GuiCtrlSetState($btnAddRebuy[$i], $GUI_DISABLE) $btnRemovePlayer[$i] = GUICtrlCreateButton("Button", $btnRemoveLeft, $lblPlayerTop + ($playerLabelSpace * $i), $btnRemoveWidth, $btnRemoveHeight) ;GUICtrlSetResizing($btnRemovePlayer[$i], $GUI_DOCKAUTO) Next GUISetState(@SW_SHOW) HotKeySet($HT_KEY_FULLSCREEN, "Fullscreen") HotKeySet($HT_KEY_SPACE, "Redraw") While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop EndIf WEnd Func Fullscreen() If WinActive($hMain) Then If $fFullscreen Then ;GUISetStyle(BitOR($WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_SYSMENU,$WS_CAPTION,$WS_OVERLAPPEDWINDOW,$WS_TILEDWINDOW,$WS_POPUP,$WS_POPUPWINDOW,$WS_GROUP,$WS_TABSTOP,$WS_BORDER,$WS_CLIPSIBLINGS), Default, $hMain) $aGuiInfo2 = WinGetPos($hMain) ConsoleWrite("******* Fullscreen *******" & @LF) ConsoleWrite("Win Left: " & $aGuiInfo2[0] & @LF) ConsoleWrite("Win Top: " & $aGuiInfo2[1] & @LF) ConsoleWrite("Win Width: " & $aGuiInfo2[2] & @LF) ConsoleWrite("Win Height: " & $aGuiInfo2[3] & @LF & @LF) ;WinMove($hMain, Default, $aGuiInfo[0], $aGuiInfo[1], $aGuiInfo[2], $aGuiInfo[3]) WinMove($hMain, Default, 238, 179, 816, 638) $fFullscreen = False $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info after Restored *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) Else ;GUISetStyle($WS_POPUP, Default, $hMain) $aGuiInfo = WinGetPos($hMain) ConsoleWrite("******* Start Size *******" & @LF) ConsoleWrite("Win Left: " & $aGuiInfo[0] & @LF) ConsoleWrite("Win Top: " & $aGuiInfo[1] & @LF) ConsoleWrite("Win Width: " & $aGuiInfo[2] & @LF) ConsoleWrite("Win Height: " & $aGuiInfo[3] & @LF & @LF) WinMove($hMain, Default, 0, 0, @DesktopWidth, @DesktopHeight) $fFullscreen = True $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info after Fullscreened *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) EndIf Else HotKeySet($HT_KEY_FULLSCREEN) Send($HT_KEY_FULLSCREEN) HotKeySet($HT_KEY_FULLSCREEN, "Fullscreen") EndIf EndFunc Func Redraw() Local $aCtrlInfo $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info before Redraw *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) GuiCtrlDelete($btnRemovePlayer[1]) $btnRemovePlayer[1] = GUICtrlCreateButton("Button", $aCtrlInfo[0], $aCtrlInfo[1], $aCtrlInfo[2], $aCtrlInfo[3]) ;GUICtrlSetResizing(-1, $GUI_DOCKAUTO) $aCtrlInfo = ControlGetPos($hMain, "", $btnRemovePlayer[1]) ConsoleWrite("******* Button Info after Redraw *******" & @LF) ConsoleWrite("Button Left: " & $aCtrlInfo[0] & @LF) ConsoleWrite("Button Top: " & $aCtrlInfo[1] & @LF) ConsoleWrite("Button Width: " & $aCtrlInfo[2] & @LF) ConsoleWrite("Button Height: " & $aCtrlInfo[3] & @LF & @LF) EndFunc Is there a way to fix this, or is the issue built in to how windows get resized?