appactivate (VB)

liquid8

Freshman
Joined
Jan 14, 2003
Messages
31
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
 
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.
 
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
 
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
 
Back
Top