Active Window
-
Hi, Is there a way to make a certain application as the active window at certain instance? For example, I want to make another application(such as print etc) as the active window while my application(vb project) is running. Also, is there a way to return the focus to my application for example by a click of certain keystrokes or button? I'm not sure what it is called, but its like controlling the input focus so that it belongs to different application at different instance. I hope you understand what I mean.
-
Hi, Is there a way to make a certain application as the active window at certain instance? For example, I want to make another application(such as print etc) as the active window while my application(vb project) is running. Also, is there a way to return the focus to my application for example by a click of certain keystrokes or button? I'm not sure what it is called, but its like controlling the input focus so that it belongs to different application at different instance. I hope you understand what I mean.
Kind of. I know where you're going with this ... SendKeys. You can change the active application using VB6's AppActive function. All you need to do is give it the window title that it needs to find. The problem is, you can guarantee it's going to stay there between the time you call AppActivate and SendKeys get's done sending its information. Once your done, to get the focus back to your own app, all you do is call SetFocus on the control on your form that you want the focus sent to. Focus can change at any time, even while you, or SendKeys, is typing in a control. It's maddening when a background service just insists on popping up a warning dialog, or someone has a IM window open, like Yahoo Messenger, and a message comes in, stealing the focus from yours or any other application! Dave Kreskowiak Microsoft MVP - Visual Basic