Alexis Posted October 14, 2009 Report Share Posted October 14, 2009 Is there any way that MEX can distinguish between 2 windows which have the same name? Maybe by position or size or by selecting it manually in a kind of learnmode? Thank You Alexandra Quote Link to comment Share on other sites More sharing options...
Cory Posted October 14, 2009 Report Share Posted October 14, 2009 I had a similar problem with Outlook a long time ago and eventually found a solution. Click here to read the thread. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 14, 2009 Report Share Posted October 14, 2009 There was something I found while reviewing new features in MEP a long while ago that I couldn't remember but a pal helped my failing memory. I don't know if it will be useful but you might check out the Variable Set Handle - Enumerate Windows with a Specific Title command. It depends on what you're doing exactly but there might be a way to use that. Quote Link to comment Share on other sites More sharing options...
Alexis Posted October 14, 2009 Author Report Share Posted October 14, 2009 Very interesting Cory, in the following macro i tried to create an array variable (windowss) with this command and activate one of those windows. I have two windows with the same name "Kalender - Microsoft Outlook" <VARIABLE SET HANDLE Option="\x00" Info="Kalender - Microsoft Outlook" Partial="FALSE" Wildcards="FALSE" Destination="%windowss%"/> <WINDOW ACTIVATE Title="%windowss[1]" Exact_Match="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/> But it does not work. Via a textbox i figured out that both variables windowss(1+2) become "Kalender - Microsoft Outlook" So maybe i have to use this Window Control stuff which i haven´t understood yet. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 15, 2009 Report Share Posted October 15, 2009 I wasn't offering this as a solution to your problem but rather answer the question of whether MEP can distinguish between two windows and the answer is "Yes". Now whether you can use this to solve your problem is another matter. Perhaps you can describe what it is you're trying to do. Obviously if you were only trying to change focus there are no window manipulation commands that will use the handle but I can think of other things one would want to do for which it could be useful. In the samples file there's a tutorial on using controls with Calculator that’s a good exercise. And Joe’s book is pretty cool at explaining. Quote Link to comment Share on other sites More sharing options...
paul Posted October 15, 2009 Report Share Posted October 15, 2009 AutoIt, which is one of the supported scripting languages in MEP, has a range of sophisticated commands for handling windows, even multiple instances with the same window title. Quote Link to comment Share on other sites More sharing options...
Alexis Posted October 16, 2009 Author Report Share Posted October 16, 2009 And Joe’s book is pretty cool at explaining. Cory, are you talking about Joseph Weinpert´s MEX Explained? Jesus, i bought it years ago. Can´t find those pdf-file. I´ll be back if i found and read it. Thanks for reminding me!!! Alexandra Quote Link to comment Share on other sites More sharing options...
rberq Posted October 16, 2009 Report Share Posted October 16, 2009 Is there any way that MEX can distinguish between 2 windows which have the same name? Maybe by position or size or by selecting it manually in a kind of learnmode? The learn mode is an excellent idea, if each window has unique characteristics. Write a little macro that checks pixel color at the mouse location, and appends the coordinates and color to a text file. [use a hotkey combination to run the recording macro, because if you actually click the mouse (rather than just position it) the application is likely to do something based on your click.] You can save the pixel color at one point or many points, in a separate file for each window. Then, when another macro wants to distinguish one window from the other, it just reads back each file of window coordinates, checks the pixel colors, and if they match perfectly you have identified the window. I have a whole application based on this method, because the application is web-based and seven different windows all have the same title. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 16, 2009 Report Share Posted October 16, 2009 Yeah, that Joe. I know it's ME3 but most of it is still relevant. I probably consult it once a month at least. Quote Link to comment Share on other sites More sharing options...
rberq Posted October 16, 2009 Report Share Posted October 16, 2009 Is there any way that MEX can distinguish between 2 windows which have the same name?Another method I have used is, click somewhere on the window (sometimes necessary with web pages), then do CTRL-a to highlight all the text, copy to clipboard, then "IF CLIPBOARD CONTAINS" some text that is unique to one window or the other. Click again on the window to un-highlight. The drawback to this, compared to checking various pixel positions, is that it's visible and potentially disruptive to the user. 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.