Hail,
I need to stop my agents from opening more than 1 session of an application (which isn't mine and which I don't have the code for). I use the API SendMessage to close the window, but I can never be sure I close the right one. I want to close the old one and not the one that just opened. (The reason they have more than one session open is that they close the app through the X and it stays in memory but disappears from the screen, this is the instance I want to get rid of.)
How should I go about this, for now I simply use a timer with find window, if more than one instance I close them all which can be annoying for users.
Phailak
I need to stop my agents from opening more than 1 session of an application (which isn't mine and which I don't have the code for). I use the API SendMessage to close the window, but I can never be sure I close the right one. I want to close the old one and not the one that just opened. (The reason they have more than one session open is that they close the app through the X and it stays in memory but disappears from the screen, this is the instance I want to get rid of.)
How should I go about this, for now I simply use a timer with find window, if more than one instance I close them all which can be annoying for users.
Phailak