Jump to content

Run Program in a Minimized Window; with MouseMove also?


Cid
 Share

Recommended Posts

Is there an option to have a program running in the background, with mouse movement and clicks and not effect your current project?  Maybe something with AutoItSetOption(), with Pixel & Mouse Coord Mode.  

Example: Playing Minesweeper minimized, while playing Heaths Maximized.

 

Link to comment
Share on other sites

Welcome to AutoIt and the forum!

Make sure to read the forum rules. A link can be found at the bottom right of each page.

Game automation of any kind isn't permitted here.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Thanks for having me.

I wan't really meaning minesweeper and hearts, It was an example of the the process I am looking to write my script to do.  I have a program I have to watch that has a green light pop up, and I have to write that code that follows it into a e-mail and send it.  I got that script working, but I want to have the window minimized so I can do other things beside just having that window open and controlling my mouse.

Link to comment
Share on other sites

Can you please be a bit mor specific? What does "watch a program that has a green light pop up" mean?

If we know which program you try to automate we can propose a secure and reliable solution.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I want to run this in the background, so I can work on other projects and this script not take control of my mouse and have the Monitor window minimized. 

#Region
#AutoIt3Wrapper_UseX64=n
#EndRegion
#include <ImageSearch.au3>

HotKeySet("{s}", "StartScript")
HotKeySet("{z}", "PauseScript")
HotKeySet("{q}", "QuitScript")

Global $Start = 0
Global $Light = 0
Global $LightX = 0
Global $LightY = 0

WinActivate("Monitor")

Func StartScript()
    $Start = 1
EndFunc

Func Light()
    Local $Light = _ImageSearcharea("LightOn.bmp", 1, 960, 0, 1440, 270, $LightX, $LightY, 100)
    If $Light = 1 Then
        MouseClickDrag("Left", $LightX, $LightY, $LightX+72, $LightY, 1)
        Send("^c")
        Run("notepad.exe")
        WinWaitActive("Untitled - Notepad")
        Send("^v")
    EndIf
EndFunc

Func PauseScript()
    $Start = 0
EndFunc

Func QuitScript()
    Exit
EndFunc

While 1
    If $Start = 1 Then
        Light()
    EndIf
    Sleep(1000)
WEnd

As for the program, it's just called Monitor.  It's a basic GUI that monitor one of the controllers in the plant.

Link to comment
Share on other sites

no it will not run.

the key component to your entire script is imagesearch. if imagesearch fails every time, your script is useless.

imagesearch can only search for an image that is present on the screen.

you might want to use the AU3Info tool in scite and see if you can get a handle on the light in the monitor program.

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