9 posts in this topic
I have a working script that changes the core affinity and process priority of multiples of a specific application I have running.
I have that part figured out.
I would like to make a little modification to it.
Windows10 introduced virtual desktops. I am trying to have different core affinity and priority of processes on the visible and non-visible desktops.
What I need is a bool function that could be described as IsWindowOnCurrentDesktop($hWnd). I have searched the winAPI.au3 but I do not believe anything like that exists built it.
I have searched multiple places before asking for help. I found a Microsoft supplied example of the function I need using C#, but I am unfamiliar with C# to a degree that I cannot port the system call over.
Help is appreciated but not expected. Thanks in advanced. In the meantime I will be learning C# syntax and class structure.
I run multiple AutoIT scripts concurrently, is there a way of distinguishing between them?
When I look under Details in task manager I just see a bunch of "AutoIt3.exe" processes. Under the processes tab I again just see a bunch of "AutoIt v3 Script" or "AutoIt v3 Script (32 bit)" applications. When I hover my mouse over the tray icon I can see the tooltip "AutoIt - Current Time.au3" but am not sure how to reference this.
For example if I run a script called "Current Time.au3", how can I determine from another au3 script if this "Current Time.au3" script is running and grab it's handle (using WinGetHandle() or similar)? Following from that l'd even like to pause/resume the script, if that's possible..
Basically i am trying to make a script that detects if the currently active window is 1920 x 1080 or bigger. If it detects a window that is active, that is indeed that size. It will do some stuff.
The problem i am having is that it is detecting my desktop whenever i click on my desktop, so it's doing stuff when i don't want it to.
So all i need to know, is how can i do a simple check to see if a window = a title.
Here is what i have so far
$wintitledesktop = WinGetTitle("[ACTIVE]") If not $wintitledesktop = "Program Manager" Then ;does stuff endif Program Manager is what my desktop is called btw.
The problem with that code is that the script is still detecting the desktop and doing the code.
In case you need the whole section of the code, here it is.
$winsizecheck1 = WinGetClientSize("[ACTIVE]") $wintitledesktop = WinGetTitle("[ACTIVE]") If WinActive("[ACTIVE]") Then sleep(100) If $winsizecheck1 >= 1920 Then If $winsizecheck1 >= 1080 Then If not $wintitledesktop = "Program Manager" Then $gamesfolderstate = WinGetState($gamesfolder) If WinExists($gamesfolder) Then If Not BitAND($gamesfolderstate, 16) Then WinSetState($gamesfolder,"",@SW_MINIMIZE) EndIf EndIf EndIf EndIf EndIf EndIf
I have been using a script at work for the last 6 months or so. It gets some information from the window title and keeps it in its memory for retrieval.
currently I am running an infinite loop to look for the window title, the information in the memory is only updated if a few window title is detected.
The trouble with this approach as you can see, is the cpu usage. I was wondering if somehow I can only run this script when a windows change event occurs, otherwise the script stays dormant.
I have no idea how to do that, searched on forum and found some solutions that were years old and did not work for me.
$oAcro = ObjCreate("acroexch.app") $oPDF = ObjCreate("AcroExch.PDDoc") $File = @ScriptDir&"\test.PDF" $oPDF.Open($File) $oJSpdf = $oPDF.getJSObject.app.opendoc($File) But how would i do this if I didn't know $File? If I wanted to connect to the Active window instead?