Coder's Guild Mailing List

Activating the System Menu.

Posted by ADnoctum on 2000-06-06

Hi all,

My program doesn't have a title bar, so y put buttons to minimize and close
the window. But I need to put a button to show the System Menu. So, haw can
I cheat windows to show the menu an pass the notification messages throw the
WM_SYSCOMMAND message. I'm using this code, but it doesn't work:

    case WM_COMMAND:
        switch(HIWORD(wParam)) {

        (...)
        case BTN_SYSMENU:
            SendMessage(hwnd, WM_NCLBUTTONDOWN, HTSYSMENU, 0);
            break;
        (...)

I have also used "TrackPopupMenuEx(g_SysMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON
| TPM_RIGHTBUTTON, rect.left, rect.top, hwnd, NULL); but then the messages
don't go throw the WM_SYSCOMMAND.

How can I do that?

Thanks
ADnoctum