Run program get winId for use in later win_ commands

Started by cssyphus, May 11, 2021, 07:16:37 AM

Previous topic - Next topic

cssyphus

Is there a quick way to run() an app, and return a window id that can be later used in other commands such as SendKeysTo() ?

For example, to run('notepad.exe', '') and get a window ID back?

td

A quick search of the "Win*" functions in the Consolidated WIL Help file reveals the following:

https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/WILLZ_W__035.htm

There are other functions that can be used in combination to get the same result or you can try and use Roboscripter to write the solution for you. However, it is best to start with the simplest solution first (using WinIdGet.)
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

cssyphus

Ah, okay, so this is a two-part thing.  For some reason, I thought I remembered there was a command that did both - not that it matters, this will work just ducky. And I didn't previously notice that winIdGet() knows to choose the most recently active instance if more than one is running.

You saved me again, Tony, thank you.