0
Reply

Plugin form start maximized

anirudh saraf

anirudh saraf

Nov 16 2007 1:35 AM
2.1k
Hi,

I am creating a plug-in for Microsoft Onenote which operates via COM Interop. The problem I am facing is that when I run my application from OneNote it always starts the form minimized.

I have tried putting 
this.WindowState = FormWindowState.Normal;
this.StartPosition = FormStartPosition.CenterScreen;
in Form Load event but it doesn't help.

I also tried Windows API calls
  IntPtr hwnd = this.Handle;
                if (IsIconic(hwnd) != false) ShowWindow(hwnd, 9);
                else SetForegroundWindow(hwnd);

and then I tried setting a timer and setting the same properties, but the form still stays minimized.

Is there any way I can insure that my form starts maximized and in centre of  Onenote?

Also can  I attach a debugger to my plug-in so that I can set breakpoints and when I execute it FROM ONENOTE it breaks and opens VStudio? 

Thanks,
Ani