Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

Try sending the window a message to return it's windowstate to Normal instead of minimized? Just a suggestion

 

-Ner

"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*
Posted
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.
Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...