Search the Community
Showing results for tags 'Active window'.
-
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. Thanks, TBWalker
- 7 replies
-
- active window
- file name
-
(and 2 more)
Tagged with:
-
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. https://blogs.msdn.microsoft.com/winsdk/2015/09/10/virtual-desktop-switching-in-windows-10/ Help is appreciated but not expected. Thanks in advanced. In the meantime I will be learning C# syntax and class structure.
- 1 reply
-
- windows 10
- windows10
-
(and 3 more)
Tagged with:
-
How do I attach to the active acrobat window and get it's javascript object? I know how to do this when i know the filename: $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?
-
Hi Again, I'm really stuck with this, I have a complex program now more than 3K lines, I'll only post the portion which is giving me a lot of headache. This slice of code will monitor where the active cursor is and when the user press enter it will call the function associated with the input field(Search Field). Each of these Search input box reside on its own Tab Control It does work pretty well HOWEVER if I left the cursor at the input field and fire up other applications such as notepad, the HotKey (enter) does not set to its default. Case Else ;user is doing something else other than pressing/clicking on buttons/controls $sFocus = ControlGetFocus($formAgentBuddy) $hFocus = ControlGetHandle($formAgentBuddy, "", $sFocus) $ctrlFocus = _WinAPI_GetDlgCtrlID($hFocus) Switch $hFocus Case $hnptSearchMeC HotKeySet("{ENTER}", "_SearchContactList") Case $hnptSearchMeR HotKeySet("{ENTER}", "_SearchReferenceList") Case $hnptSearchMeK HotKeySet("{ENTER}", "_SearchAccountList") Case $hnptSearchMeM HotKeySet("{ENTER}", "_SearchTemplateList") Case $hnptSearchMeL HotKeySet("{ENTER}", "_SearchAlarmList") Case Else HotKeySet("{ENTER}") EndSwitch I tried using GUISetAccelerators but I guess this cannot be dynamically changed like Case Else ;user is doing something else other than pressing/clicking on buttons/controls $sFocus = ControlGetFocus($formAgentBuddy) $hFocus = ControlGetHandle($formAgentBuddy, "", $sFocus) $ctrlFocus = _WinAPI_GetDlgCtrlID($hFocus) Switch $hFocus Case $hnptSearchMeC Dim $AccelKeys[1][2]=[["{ENTER}",$btnSearchContactList]] GUISetAccelerators($AccelKeys) Case $hnptSearchMeR Dim $AccelKeys[1][2]=[["{ENTER}",$btnSearchReferenceList]] GUISetAccelerators($AccelKeys) Case $hnptSearchMeK ;.... and so on Case $hnptSearchMeM ;.... and so on Case $hnptSearchMeL ;.... and so on Case Else Dim $AccelKeys = "" EndSwitch I also tried to monitor the Active Window with WinGetState and use BitAnd with an 8 but sadly that doesn't also do the trick even if I switch to other application my program seem to be still active even when its already greyed out like if I left the cursor at the Search Field(input Box) and I press enter in notepad instead of giving me a new line in notepad it executes the search in my application.
-
If I run the following code in SciTE, I get the first seven characters of the title. But if I run its executable, I got a "0" in the msgbox. What am I missing?
- 8 replies
-
- WinGetTitle
- WinGetHandle
-
(and 1 more)
Tagged with: