robinread Posted July 22, 2005 Posted July 22, 2005 Hi all, Just a newbie here... Tried to use WinList() and ProcessList() to uniquely identify a window. Problem is that the ProcessList() that I'm looking for "VMAGIC.EXE" between 2 sessions of VMAGIC.EXE are the same of course, but the WinList() title between the 2 sessions are different. Yes the titles are different...wildly different. Why I need to know? Server environment. 2+ sessions of VMAGIC.EXE running. Each one doing its own keystroke macro Send() thang. I need to open my session of VMAGIC.EXE and do my Send() thang to it. Got any ideas? between WinGetClassList(), ProcessList(), and WinList() I can't find a way to "relate" any of the information from them all. If I could I'd probably have this licked! Thanks, Robin
herewasplato Posted July 25, 2005 Posted July 25, 2005 I truely do not understand your problem - but you have had no replies - so, I'll try and help. You say that you have multple sessions of VMAGIC running - each with a different title. If you start "your session of VMAGIC" will the title be unique from the others? (just use the AutoIt Window Info tool to determine this) If the title is unique, then you can rename it using WinSetTitle before sending keys to it... or use WinGetHandle and "send" things to the window via the "control" series of functions. later... [size="1"][font="Arial"].[u].[/u][/font][/size]
robinread Posted July 25, 2005 Author Posted July 25, 2005 I truely do not understand your problem - but you have had no replies - so, I'll try and help.You say that you have multple sessions of VMAGIC running - each with a different title. If you start "your session of VMAGIC" will the title be unique from the others? (just use the AutoIt Window Info tool to determine this) If the title is unique, then you can rename it using WinSetTitle before sending keys to it... or use WinGetHandle and "send" things to the window via the "control" series of functions.later...<{POST_SNAPBACK}>Well..."using WinSetTitle before sending keys to it".Good one! I'll give it a try and reply back with results.Also, I thing I can determine which VMAGIC window is mine by doing a WinList() beforerun VMAGICWinList() after and do a before and after comparison of Window handles...hopefully the difference is "my" VMAGIC. (at least that's how I do it in VB). What do you think of my methodology? Anyway, if I do this b4/after thing then I would already have my Windows handle and it's a bit of code...I just thought that you guru's might have a faster way.More suggestions welcome!Oh, and big THANKS for helping HereWasPlato! Robin
herewasplato Posted July 25, 2005 Posted July 25, 2005 (edited) ...you are welcome... Is there something unique about a new VMAGIC window - something like Notepad has when it is opened without a file --- "Untitled - Notepad"? Or can VMAGIC be called with a file that would show in the window title? VMAGIC - my_start_up_file... Yes, you can certainly do the before/after winlist and find the delta - I've just never had the need to do so. A unique title is all you need to send keys to a unique window (and you said that each VMAGIC session already had a unique window title - this is part of what I did not [and still do not] understand... if that is the case, then what is the problem?) WinActivate("VMAGIC - filename123","maybe some text here") WinWaitActive("VMAGIC - filename123","maybe some text here") Send("a") WinActivate("VMAGIC - filename188","maybe some text here") WinWaitActive("VMAGIC - filename188","maybe some text here") Send("a") maybe I'm missing something here... Edited July 25, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now