Exemple #1
0
        /// <devdoc>
        ///     WM_CREATE handler
        /// </devdoc>
        /// <internalonly/>
        private void WmCreate(ref Message m) {
            base.WndProc(ref m);
            NativeMethods.STARTUPINFO_I si = new NativeMethods.STARTUPINFO_I();
            UnsafeNativeMethods.GetStartupInfo(si);

            // If we've been created from explorer, it may
            // force us to show up normal.  Force our current window state to
            // the specified state, unless it's _specified_ max or min
            if (TopLevel && (si.dwFlags & NativeMethods.STARTF_USESHOWWINDOW) != 0) {
                switch (si.wShowWindow) {
                    case NativeMethods.SW_MAXIMIZE:
                        WindowState = FormWindowState.Maximized;
                        break;
                    case NativeMethods.SW_MINIMIZE:
                        WindowState = FormWindowState.Minimized;
                        break;
                }
            }
        }
Exemple #2
0
 public static extern void GetStartupInfo([In, Out] NativeMethods.STARTUPINFO_I startupinfo_i);