views:

321

answers:

3

I've obtained the handle to a processes Main Window and would like to force that window to full screen. I'm programming in c#.Net with .Net framework V2.0 SP1

+2  A: 

Here is an article that shows you how to do this. It requires P/Invoke into the Windows API for most of the calls, however.

Reed Copsey
A: 

ShowWindow - p/invoked, of course.

Mark Brackett
+1  A: 
    public void MaximizeForm(IntPtr handle)
    {
        Control c = Control.FromHandle(handle);
        Form c_form = c as Form;
        if (c_form != null)
        {
            if (c_form.InvokeRequired)
            {
                this.BeginInvoke(new MethodInvoker(delegate() { MaximizeForm(handle); }));
            }
            else
            {
                c_form.WindowState = FormWindowState.Maximized;
            }
        }
    }
SwDevMan81