Recently Browsing 0 members
No registered users viewing this page.
I'm trying to build a script that will eventually create a log with time stamps of the active windows used on a workstation throughout the day, but I'm having a problem figuring out how to actually get this information. For example, if someone has Microsoft Word open, I'd like to be able to pop-up/log "word.exe" along with the full path to that file if at all possible (sort of like seeing the application DETAILS name in Windows Task Manager and being able to right-click on the name and choose "Open FIle Location" to get the full path to the file).
Is what I'm asking even possible within the realm of AutoIt? I have the below script as a test that gets me the current active window handle and title in a message box every 6 seconds, but for the life of me, I don't know what code I need to use to get the actual .EXE name/path of the active window.
#include <MsgBoxConstants.au3> Local $i = 0 Do Global $handle = WinGetHandle("[ACTIVE]") Global $title = WinGetTitle("[ACTIVE]") MsgBox(0,"Active Handle & Title",$handle & " - " & $title, 3) $i = $i + 1 Sleep(3000) Until $i = 100 Any help or suggestions would be greatly appreciated. I don't mind figuring out the code myself, if someone could just point me in the right direction.
#Include <WinAPI.au3> local $ClassName = _WinAPI_GetClassName(WinGetHandle(WinGetTitle("[ACTIVE]"))) ControlClick(WinGetTitle("[ACTIVE]"), "", "[CLASS:"&$ClassName&"; INSTANCE:1]", "primary") When I am running this script it just gives me a ConsoleWrite output of "0x001D04A8"
When using "AutoIT v3 Window Info" all the info I need for the ControlClick is there and displayed perfectly as if I typed it in normally.
Upon click the button it should be clicking it, I see the following inn the console window:
If I replace the $ClassName with the actual ClassName of "WindowsForms10.BUTTON.app.0.3296db7_r14_ad1" it works just fine, any ideas???
I have autoit program on my computer only portable version. I use Autoit vs 184.108.40.206
I want to use WinGetTitle but it always return 0.
I want to use it for retriev windows title and then i want to switch between windows.
E.g. - On start is msgbox where is info - "now choose yourt first window", i click first win - e.g. Excel, then 2. msgbox "now choose your 2. window" and i choose e.g. window folder. Then i want, that my script will switch between this windws and make my routine.
But my test code for retrieve win title still return 0. I try this on comp in work. I dont have admin rights but i belive, that this is not a reason, bacause Au3.SPY, show me win title correctly.
This is my sample code.
Pls. any suggestions?
thx a lot
Sleep( 2000 ) ; Allows switching to some other window to see if can get its title. $title = WinGetTitle("[active]") If $title Then MsgBox(0, "", $title) Else MsgBox(0, "", "nothing") EndIf
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.