liquid8 Posted March 25, 2003 Posted March 25, 2003 appactivate i am trying to use appactivate to return focus to an application run by a process. When the application is in a window, it works fine, however, since the application that i am using goes to fullscreen, it will not completely return focus. The task gets focus in the taskbar, but it does not return back to fullscreen. Is there another way I can do this, or a way with appactivate? I am trying to avoid using sendkeys. Thanks, LiQuiD8 Quote
*Experts* Nerseus Posted March 25, 2003 *Experts* Posted March 25, 2003 Try sending the window a message to return it's windowstate to Normal instead of minimized? Just a suggestion -Ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
*Gurus* Derek Stone Posted March 25, 2003 *Gurus* Posted March 25, 2003 You might try a combination of [api]ShowWindow[/api], [api]SetWindowPos[/api] and [api]BringWindowToTop[/api], all of which are Win32 API functions. Of course using these depends on getting the handle of the window in question, which can be difficult in many situations. Quote Posting Guidelines
liquid8 Posted March 25, 2003 Author Posted March 25, 2003 I have been trying to use ShowWindow but was having some problems with it. I will try a few of these suggestions tonight and let you know the outcome. Just wondering, the VB.NET counterparts to these functions are all under system.windows.forms - i take it you can't pass another applications handle to these? Oh, and getting the handle of the app is not a problem. I am starting the app with process.start which has a function to return the handle. Thanks, LiQuiD8 Quote
liquid8 Posted March 27, 2003 Author Posted March 27, 2003 after a few nights of trying with ShowWindow, setforegroundwindow and a bunch of other API calls, the best I can do is still just get it to focus on the application, but not open it up. I have it working right now, sending AppActivate and using system.threading.thread.wait(700), then sending enter with sendkeys, but I don't want to rely on this method. I looked into using SendMessage, but how would I go about using it to change the windowstate? Also, how come most of the sites that show how to do api stuff don't tell you what the constants are? They show you the code with WA_RESIZE or whatever but they don't tell you what it is supposed to equal. The code is pretty much useless without that. Thanks again, LiQuiD8 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.