IrkenElite86 Posted December 14, 2018 Posted December 14, 2018 Hello There. I'm hoping that someone can help me. I'm trying to run a script that will WinActivate a window that does not have a title. The intention is just to bring the app to the front of all the windows on my desktop. The class is CLASS:WindowsForms10.Window.8.app.0.11c7a8c I've tried the following, and it does not work... am I missing something? WinActivate("[CLASS:WindowsForms10.Window.8.app.0.11c7a8c]","") Is there any other way to call this application with no title?
AutoBert Posted December 14, 2018 Posted December 14, 2018 Use handle of window, but remember it's not fix.
IrkenElite86 Posted December 14, 2018 Author Posted December 14, 2018 47 minutes ago, AutoBert said: Use handle of window, but remember it's not fix. Unfortunately I need something fixed, as this will be for a long term application.
Nine Posted December 14, 2018 Posted December 14, 2018 how come position is -1808 (minus 1808) ? Is it a hidden window ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
IrkenElite86 Posted December 14, 2018 Author Posted December 14, 2018 2 minutes ago, Nine said: how come position is -1808 (minus 1808) ? Is it a hidden window ? Triple screen monitor setup. This was done on the left most monitor.
Nine Posted December 14, 2018 Posted December 14, 2018 Have you tried to WinGetHandle (...) first ? How do you know it is not working ? What is the error code ? Try [ACTIVE], see what is going on “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
IrkenElite86 Posted December 14, 2018 Author Posted December 14, 2018 28 minutes ago, Nine said: Have you tried to WinGetHandle (...) first ? How do you know it is not working ? What is the error code ? Try [ACTIVE], see what is going on So here is my code i'm using for getting the Handle #include <MsgBoxConstants.au3> Example() Func Example() Local $hWnd = WinGetHandle("[CLASS:WindowsForms10.Window.8.app.0.11c7a8c]") If @error Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred when trying to retrieve the window handle of the app") Exit EndIf MsgBox($MB_SYSTEMMODAL, "", $hWnd) WinActivate($hWnd) EndFunc ;==>Example The handle it returns is "0x00020B12" as you can see by the image at the start, the handle there shows something different... so it doesn't actually work either...
Nine Posted December 14, 2018 Posted December 14, 2018 43 minutes ago, IrkenElite86 said: as you can see by the image at the start, the handle there shows something different... so it doesn't actually work either... On the contrary, it means it has worked. Otherwise the handle would be 0 ! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
IrkenElite86 Posted December 14, 2018 Author Posted December 14, 2018 3 minutes ago, Nine said: On the contrary, it means it has worked. Otherwise the handle would be 0 ! Good point... But it still doesn't bring the window forward, is there another command i can use to do this? Sorry, I'm still fairly new to AutoIt, and I do appreciate your help
Nine Posted December 14, 2018 Posted December 14, 2018 use the $hWnd handle on winactivate. Report the result like $result = WinActivate ($hWnd) and remember that a window that is "Always On Top" could still cover up a window you Activated. After a successful activation @extended is set to 1 if the the window was already active, 2 if not. msgbox both $result and @extended IrkenElite86 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
IrkenElite86 Posted December 14, 2018 Author Posted December 14, 2018 26 minutes ago, Nine said: use the $hWnd handle on winactivate. Report the result like $result = WinActivate ($hWnd) and remember that a window that is "Always On Top" could still cover up a window you Activated. After a successful activation @extended is set to 1 if the the window was already active, 2 if not. msgbox both $result and @extended Thank you Nine. I decided to try the script on another application, and everything is working flawlessly. It appears to be just this one application that doesn't want to play nice. I'll have to keep playing around to find a different class value that it will accept and allow itself to be controlled. Thank you for all your help!
jdelaney Posted December 14, 2018 Posted December 14, 2018 Also an option to get the window using a regexp on the class. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now