What kind of window is opened? There are two ways I thought of going about doing this...
If the application started is something with an actual interface window and doesn't just work in the background, use the GetForegroundWindow API to get its handle... or branching from that, you could use one of the examples in vb-world's topic areas do retrieve a list of available window before and after the application is run, and then after. Compare the two and you'll get the window of the application. Last but not least, it just made me think of an AppActivate statement in the VB4 help file... see if you can mutilate it for your purposes.
Code:' AppActivate can also use the return value of the Shell function. MyAppID = Shell("C:\WORD\WINWORD.EXE", 1) ' Run Microsoft Word. AppActivate MyAppID ' Activate Microsoft ' Word.




Reply With Quote