CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2008
    Posts
    90

    [RESOLVED] Problem in disabling close button(X) of window.

    Hi,
    I am trying to work on an application that disables the close button (X) on the upper right hand corner of a window. In order to do that I need to use calls to API methods like GetSystemMenu, EnableMenuItem and RemoveMenu. I can figure out how these methods work but there are certain parameters that these methods have whose values that need to be passed to them as argument is unknown to me. How can I know them.

    E.G.- for EnableMenuItem, the parameters are- hMenu (handle to the menu), uIDEnableItem (The menu item to be enabled, disabled, or grayed), uEnable (This parameter must be a combination of at least two of the following:
    MF_BYCOMMAND or MF_BYPOSITION
    MF_ENABLED, MF_DISABLED, or MF_GRAYED)

    Now when I call this method from my application I supply the current window handle as the first argument, the item no. to be disabled/enabled as the second argument but I CAN'T UNDERSTAND WHAT TO SEND AS THE THIRD ARGUMENT. What exactly are the possible values for those parameters- MF_BYCOMMAND or MF_DISABLED. I checked certain examples where they are supplying hexadecimal values like &HF060, &H1, 0x400, 0x1000, 0x2 etc. or integer values like 1024, 2 etc. But how would I know what exactly these values are and when to use which value. The same problem arises in case of calling RemoveMenu method. If you know about any chart or tutorial that lists the values of these parameters then plz refer. Waiting for your help. Thanks.

  2. #2
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Problem in disabling close button(X) of window.

    Take a look at this thread. it is already discussed there
    http://www.codeguru.com/forum/showthread.php?t=359675

    And www.pinvoke.net contains lot of reference related to Win32 API's.

  3. #3
    Join Date
    Sep 2008
    Posts
    90

    Smile Re: [RESOLVED] Problem in disabling close button(X) of window.

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured