Click to See Complete Forum and Search --> : Visual Basic


October 1st, 1999, 07:42 AM
How can I write codes in visual basic to search any other application that are currently running at windows Background ?

chilakamati
October 2nd, 1999, 03:09 AM
If the application has an visual interface then you could the following.
You can use the FindWindow and the SetWindowPos APIs to find a window and bring it to focus.
for eg.,
Suppose the NotePad or the Calculator application is running behind your application.
You could use the FindWindow API to search for the NotePad window and return its window handle to you.
The you could use the SetWindowPos API to bring the NotePad window to focus using the window handle
returned to you by FindWindow.

October 5th, 1999, 07:39 AM
Hi chilakamati/all,
My problem is somewhat related to this doubt. I'm trying to find whether a previous instance of an application is running, if so bring it to front when I try to run the same appln. again. I could detect it using the App object's PrevInstance property. But when finding the window handle of the already running app. using FindWindow, which takes the app's title as parameter, it returns the current window's handle itself since it's having the same title... Pls help me how to achieve this! Thanx in adv.

---Siva.