Jump to content
Macro Express Forums

Activating all window with a specific (the same name)


Recommended Posts

Sometimes i use more than one instance of a program. Now i have two windows with the same name.

s there a way to activate both of them? I only manage to activate one of those?

 

I think i already asked this long ago. But if i go on my profile "My Content" i only see my posts from this year. How can i find / filter my older posts?

 

Thank You

Alexandra

Link to comment
Share on other sites

It is impossible. In Windows only one window can be active at one time.

 

You may want to look into the Handles capability of MEP. I got into them when the feature was first released but my recollection is vague now. But I do remember it solved my problem of multiple windows with the same title. However I also seemed ot remember it was more than a little tricky and I remember writing up my findings here on the forum.

Link to comment
Share on other sites

Correct. As I see it MEP will always stop after activating the first window which is probably the one with the lowest handle. I don't have time to review this and my recollection is vague but I seemed to remember I was at one time very stoked about the handles feature but was disappointed to find it the second shoe didn't drop. It was something like we could go thru all the windows and get their unique handles but was given no facility to activate by handle. Check the message archives if you're interested but I think it was something like this.

Link to comment
Share on other sites

No, it does not work. I don´t see how i can make two windows with the same name visible.

 

MEX only addresses one of those two regardless of the used commands like "Window Activating" or "Set Window Order"

Try this (Cory is mistaken when he says you cannot activate a window using its handle).

 

Program Launch: "notepad.exe" (Normal)

Parameters:

Program Launch: "notepad.exe" (Normal)

Parameters:

Variable Set Handle %hWin% from all windows with the title of "Notepad"

Text Box Display:

Window Activate: %hWin[1]%

Text Type (Simulate Keystrokes): <ENTER><ENTER><ENTER>This is the active notepad window

Wait for Text Playback

Window Activate: %hWin[2]%

Text Type (Simulate Keystrokes): <ENTER><ENTER><ENTER>This is the active notepad window - should be different to the first notepad window activated

Wait for Text Playback

 

<PROGRAM LAUNCH Path="notepad.exe" Mode="\x00" Default_Path="TRUE" Wait="1" Get_Console="FALSE"/>
<PROGRAM LAUNCH Path="notepad.exe" Mode="\x00" Default_Path="TRUE" Wait="1" Get_Console="FALSE"/>

<VARIABLE SET HANDLE Option="\x00" Info="Notepad" Partial="TRUE" Wildcards="FALSE" Destination="%hWin%"/>

<TEXT BOX DISPLAY Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang3081{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 Move one of the notepad windows to a different location so that you can see both (resize if desired), then press ENTER\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="2" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

<WINDOW ACTIVATE Title="%hWin[1]%" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>

<TEXT TYPE Action="0" Text="<ENTER><ENTER><ENTER>This is the active notepad window"/>

<WAIT FOR TEXT PLAYBACK Indefinite="FALSE" Hours="0" Minutes="0" Seconds="10"/>

<WINDOW ACTIVATE Title="%hWin[2]%" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>

<TEXT TYPE Action="0" Text="<ENTER><ENTER><ENTER>This is the active notepad window - should be different to the first notepad window activated"/>

<WAIT FOR TEXT PLAYBACK Indefinite="FALSE" Hours="0" Minutes="0" Seconds="10"/>
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.

Guest
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.

Loading...
×
×
  • Create New...