xamlmenu

How are the Size and Move commands implemented in a system menu?


I have styled a window to replace the standard window chrome with a standard 'System Menu' popup and I want to implement Size and Move using the keyboard. Anyone done this or have an example?


Solution

  • Assuming that there is a standard Win32 window under everything, you go into keyboard move/size mode by sending a message to the window procedure.

    SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE, 0);
    SendMessage(hwnd, WM_SYSCOMMAND, SC_SIZE, 0);