Alexis Posted April 19, 2013 Report Share Posted April 19, 2013 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 Quote Link to comment Share on other sites More sharing options...
Cory Posted April 19, 2013 Report Share Posted April 19, 2013 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. Quote Link to comment Share on other sites More sharing options...
Alexis Posted April 19, 2013 Author Report Share Posted April 19, 2013 I mean not making them both active! I just meant making them visible. But now it strikes me i could use "Repeat with windows" and the "Set window order" command! Thank You Alexandra Quote Link to comment Share on other sites More sharing options...
Alexis Posted April 19, 2013 Author Report Share Posted April 19, 2013 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" Quote Link to comment Share on other sites More sharing options...
Cory Posted April 23, 2013 Report Share Posted April 23, 2013 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. Quote Link to comment Share on other sites More sharing options...
paul Posted April 23, 2013 Report Share Posted April 23, 2013 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"/> Quote Link to comment Share on other sites More sharing options...
Cory Posted April 29, 2013 Report Share Posted April 29, 2013 The Window Activate command accepts a handle variable? Quote Link to comment Share on other sites More sharing options...
paul Posted April 30, 2013 Report Share Posted April 30, 2013 The Window Activate command accepts a handle variable? Oh, you already know this! See http://pgmacros.invisionzone.com/topic/5013-how-to-activate-ms-word-reliably-fails-on-multiple-configurations-and-macro-coding-methods/?hl=handle#entry21543 !!! Quote Link to comment Share on other sites More sharing options...
Cory Posted May 2, 2013 Report Share Posted May 2, 2013 Now that's funny! All the things I knew but have forgotten. Thanks Paul! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.