ACAT.Lib.Core.Utility.Windows.ShowInactiveTopmost C# (CSharp) Метод

ShowInactiveTopmost() публичный статический Метод

Show the window as topmost without activating it. Sets the form's parent to parentForm
public static ShowInactiveTopmost ( Form parentForm, Form form ) : void
parentForm System.Windows.Forms.Form the parent of the form
form System.Windows.Forms.Form the form
Результат void
        public static void ShowInactiveTopmost(Form parentForm, Form form)
        {
            if (form.InvokeRequired)
            {
                form.Invoke(new show(ShowInactiveTopmost), parentForm, form);
            }
            else
            {
                const int SW_SHOWNOACTIVATE = 4;
                const int HWND_TOPMOST = -1;
                const uint SWP_NOACTIVATE = 0x0010;

                form.Owner = parentForm;

                User32Interop.ShowWindow(form.Handle.ToInt32(), SW_SHOWNOACTIVATE);
                User32Interop.SetWindowPos(form.Handle.ToInt32(), HWND_TOPMOST,
                                            form.Left, form.Top, form.Width, form.Height,
                                            SWP_NOACTIVATE);
            }
        }