CairoDesktop.MenuBar.WndProc C# (CSharp) Method

WndProc() public method

public WndProc ( IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam, bool &handled ) : IntPtr
hwnd System.IntPtr
msg int
wparam System.IntPtr
lparam System.IntPtr
handled bool
return System.IntPtr
        public IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam, ref bool handled)
        {
            if (appbarMessageId == -1)
            {
                return IntPtr.Zero;
            }

            if (msg == appbarMessageId)
            {
                System.Diagnostics.Trace.WriteLine("Callback on AppBarMessage: " + wparam.ToString());
                switch (wparam.ToInt32())
                {
                    case 1:
                        // Reposition to the top of the screen.
                        if (this.Top != 0)
                        {
                            System.Diagnostics.Trace.WriteLine("Repositioning menu bar to top of screen.");
                            this.Top = 0;
                        }
                        /*SHAppBarMessageHelper.QuerySetPosition(hwnd,
                            new System.Drawing.Size() { Height = (int)this.ActualWidth, Width = (int)this.ActualWidth },
                            SHAppBarMessage1.Win32.NativeMethods.ABEdge.ABE_TOP);*/
                        break;
                }
                handled = true;
            }

            return IntPtr.Zero;
        }