Jump to content
Macro Express Forums

Display Only "top-level" Windows


Recommended Posts

Does anyone know of a way to show only the names of the Titles of the windows listed in the Alt+Tab menu of Windows (i.e. parse this list down of all those listed in Repeat with Windows - Visible Windows)?


"Alt-Tab is the common name for a complex keyboard shortcut on Microsoft Windows 3.1 onwards used for switching between top-level windows without using the mouse; hence it was named Task Switcher ...", source http://en.wikipedia.org/wiki/Alt-Tab.


I created macro ActiveWindowT91 to Active Window with the text in variable T91 (e.g. T91 = "Notepad"). If the window is running, the macro will activate the window if it is not currently on top.

<REM2:ActiveWindowT91><REM2:Running?><IFOTH:12:2:%T91%><REM2:No, prompt user to select window in case program can't find it.><MACRUN2:PromptWindowT91><ENDIF><REM2:On top?><IFOTH:11:2:%T91%><REM2:No, put on top.><ACTIVATE2:%T91%><IMSD:0010><ENDIF>


If the text in T91 is not part of a currently running window, the macro will run macro PromptWindowT91, which will prompt the user to select a Window Title by utilizing the Repeat with Windows Command (Visible Windows).

<REM2:T91 - Window to Interface with.><TVAR2:91:01:><REM2:Build list of active windows for user to select from.><REM2:T8 - CrLf><ASCIIC:7:1:10><ASCIIC:8:1:13><TMVAR2:08:08:07:000:000:><REM2:T79 - Visible Window List><TVAR2:79:01:><REPEATWIN:99:2:2><TMVAR2:08:79:99:000:000:><TMVAR2:08:79:08:000:000:><ENDREP><REM2:Remove Program Manager.><TMVAR2:21:79:00:000:000:%T8%Program Manager><REM2:T91 - Prompt for Window to Interface with.><MENU2:1:T:91:00LeftBottom:WindowProgram cannot find source/destination window to interface with.  Please select applicable window from list below or click Cancel to abort process.%T79%>


The list displayed via Multiple Choice Menu contains windows that are visible, but the user could select a Title from the list that is not the desired window to interface with (e.g. Macro Express, instead of Macro Express - Macro Explorer). Using the mouse to click on the Title bar doesn't work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...