Thread: System Menu

  1. #1
    Registered User
    Join Date
    Jan 2005

    System Menu

    Hi all.

    When I click on the default icon on the left of my taskbar, a little menu pops up. I think it's called the system menu. Is there a way to prevent the menu from appearing, but without removing the icon.

    One method I tried just deleted the icon and the close button. I still want the close button functional.


  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    I don't know, but perhaps you can do some perverted hack using GetSystemMenu() and ModifyMenu()

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Join Date
    Jan 2002
    Handle the WM_NCHITTEST message and return HTCAPTION(if you want to still be able to move/drag the window by that part of the caption) or HTNOWHERE if you don't want any action for the area covered by the small icon. You should check the existing window styles so you can accurately calculate the exact dimensions of the corner of the window occupied by the small icon. Something like:
    case WM_NCHITTEST:
      RECT rc;
      int mouse_x=LOWORD(lParam);
      int mouse_y=HIWORD(lParam);
      static const int small_icon_wd=GetSystemMetrics(SM_CXSIZE);
      static const int small_icon_ht=GetSystemMetrics(SM_CYCAPTION)+
      if (mouse_x<=(rc.left+small_icon_wd) && mouse_y<=(
        return HTCAPTION;
      return DefWindowProc(hwnd,uMsg,wParam,lParam);
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Haven't been on in a while, but yeah that sounds about right.
    Cheers Ken.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 06-13-2005, 09:03 AM
  2. Replies: 3
    Last Post: 06-13-2005, 07:28 AM
  3. pop up menu problem
    By bigtamscot in forum Windows Programming
    Replies: 5
    Last Post: 06-10-2003, 01:46 AM
  4. Menu stuff
    By Shadow in forum C Programming
    Replies: 10
    Last Post: 04-28-2002, 09:05 AM
  5. quick question about C Dos text menu pgm i was doing
    By Shadow in forum C Programming
    Replies: 2
    Last Post: 09-16-2001, 10:26 AM