JumpsInLava Posted October 9, 2003 Posted October 9, 2003 Hi everybody. I'm launching an app kinda like this: Dim duhProcess As Process = New Process duhProcess.StartInfo.FileName = "Notepad" duhProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal duhProcess.Start() Then I'm doing some other stuff kinda like this: 'need sumthin here AppActivate(duhProcess.Id) SendKeys.SendWait("This is text.") How do I restore or maximize the other app if it has been minimized? Quote
*Gurus* Derek Stone Posted October 10, 2003 *Gurus* Posted October 10, 2003 You'll need to invoke the Win32 API function [api]SetForegroundWindow[/api]. Quote Posting Guidelines
*Experts* Volte Posted October 10, 2003 *Experts* Posted October 10, 2003 Actually, you'll probably need [api]SetWindowPlacement[/api] if you actually want to change the window state. SetForegroundWindow will just bring it to the front. There's an example of using the API on the site that you can transfer to .NET easily - just change the Longs in the declaration to Int32s, and the hWnd params to IntPtr. Quote
JumpsInLava Posted October 13, 2003 Author Posted October 13, 2003 Thank you for the replies. Well, I found that by using SendKeys I can send a %( R) or a %( X) to restore or maximize which is kind of what SetWindowPlacement does, and that works, but I would prefer to just activate it, and pop it up in its last state, like what happens when you click on an app that is minimized in the task bar. P.S. I'm converting my stuff to use SendMessage because of the problems I keep having with SendKeys....If I find something in there, I will post it. 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.