SidebarDiagnostics.Windows.AppBarWindow.MoveHook C# (CSharp) Method

MoveHook() private method

private MoveHook ( 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
        private IntPtr MoveHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if (msg == WM_WINDOWPOSCHANGING.MSG)
            {
                WINDOWPOS _pos = (WINDOWPOS)Marshal.PtrToStructure(lParam, typeof(WINDOWPOS));

                _pos.flags |= WM_WINDOWPOSCHANGING.SWP_NOMOVE;

                Marshal.StructureToPtr(_pos, lParam, true);

                handled = true;
            }

            return IntPtr.Zero;
        }