Hi guys,
I'm attempting to get the title of the currently active window.
Not necessarily the AMS project window.
The same title string if you were to alt-tab to a single instance of
an application.
Please correct me if wrong on following, I would love that !
Unless I'm overlooking something we have at our disposal:
- Window.SetText (not GetText), this doesn't help
- Winapi.GetActiveWindow (which returns windows handle, not title)
- Window.EnumerateTitles(); which is a lot of messing around to target the active window title
as there could be many child processes for that application. (I maybe missing something here ?)
I've looked at other script languages which appear to handle GetActiveWindow
and return the active window title.
For example.
currentwin = WinGetactive( )
Message("WinGetActive", "Current window is %currentwin%.")
However, like all of us, its much nicer to keep the project all native AMS/Lua code.
I thought I would find Window.GetText in our standard actions in a second.
I believe the solution would help everybody. If I have overlooked something,
apologies, and thanks for reading.
I'm attempting to get the title of the currently active window.
Not necessarily the AMS project window.
The same title string if you were to alt-tab to a single instance of
an application.
Please correct me if wrong on following, I would love that !
Unless I'm overlooking something we have at our disposal:
- Window.SetText (not GetText), this doesn't help
- Winapi.GetActiveWindow (which returns windows handle, not title)
- Window.EnumerateTitles(); which is a lot of messing around to target the active window title
as there could be many child processes for that application. (I maybe missing something here ?)
I've looked at other script languages which appear to handle GetActiveWindow
and return the active window title.
For example.
currentwin = WinGetactive( )
Message("WinGetActive", "Current window is %currentwin%.")
However, like all of us, its much nicer to keep the project all native AMS/Lua code.
I thought I would find Window.GetText in our standard actions in a second.
I believe the solution would help everybody. If I have overlooked something,
apologies, and thanks for reading.
Comment