3 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 recently upgraded my laptop to one with Windows 10 and higher screen resolution. In the process I found that some of my scripts did not work right when using Autoit's @DesktopWidth and @DesktopHeight macros. Insteat of 1920 x 1080 resolution Autoit detects 1536 x 864. Thus, GUIs designed to appear near the right edge of the screen displayed closer to the horizontal middle of the screen. I assume others may have the same problem.
A search on this forum and Microsoft Script Center helped me to write the following script that gets the true screen width and height from WMI.
MsgBox(0, '', _GetMonitorInfo())
Local $oWMI, $Listing, $sWidth = 0, $sHeight = 0
$oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
If IsObj($oWMI) Then
$Listing = $oWMI.ExecQuery("SELECT * FROM Win32_DesktopMonitor")
If IsObj($Listing) Then
For $oItem In $Listing
$sHeight = $oItem.ScreenHeight
$sWidth = $oItem.ScreenWidth
Return "Width: " & $sWidth & @CRLF & "Height: " & $sHeight
Hopefully it will benefit others. I for sure am very happy with all the samples I been able to find here in the past.
I'm using this method to draw a transparent image inside my window. It works, but not as expected. With that example - without minimize button or anything else and the _GDIPlus_GraphicsDrawImageRect inside the main loop -, it works, but when you need to refresh the window, like restoring it after minimized or when you drag some window above your autoit window, the draw just gone. How can I refresh the image, for example, when I display one MsgBox and minimize and restore the window with the MsgBox opened?
Try the example below. Run the script and the image will show, then minimize and restore. Then click on the button, keep the MsgBox opened, minimize and restore... The image just disappears. How can I keep it?
I was looking for a way to find out how long my PC had been running a few weeks ago and had trouble finding something that satisfied my needs, I found a Visual Basic Script that worked but found it too long. But searching trough AutoIt WINAPI help found that it really was as simple as the following little script.
Local $Uptime = _WinAPI_StrFromTimeInterval(_WinAPI_GetTickCount())
MsgBox(0, '', "PC Uptime ==> " & $UpTime)
Hope it helps...
I can't get this to work.
ControlSetText("[CLASS:#32770]", "", "[CLASS:Edit; INSTANCE:3]", $sString) Am I doing something wrong? The string is not blank, I checked it with a message box.
Here is the information from the window:
>>>> Control <<<< Class: Edit Instance: 3 ClassnameNN: Edit3 Name: Advanced (Class): [CLASS:Edit; INSTANCE:3] ID: 1001 Text: Position: 47, 78 Size: 187, 14 ControlClick Coords: 112, 9 Style: 0x50000380 ExStyle: 0x00000000 Handle: 0x000000000021064A