Thread: enable disabled menu item.

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    7

    enable disabled menu item.

    I need a technic how to enable and/or click on a disabled menu item of MDI style program (not my program, and I don't have sources). Item is a subitem in File menu. OS is win2000pro. It is possible to find windowproc of this process and post appropriate message as if it was sent by this subitem?

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    What API are you using?
    In MFC I use:

    CMenu *menu = (CMenu* )GetMenu()
    // This will disable
    menu->EnableMenuItem( ID_MENU /*your menu ID*/, MF_GRAYED );

    // This will enable
    menu->EnableMenuItem( ID_MENU /*your menu ID*/, MF_ENABLED );
    Don't talk to strangers, unless they offer candy.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    7
    This was not newbie question. Of course I know how to enable/disable menu Items using winapi, MFC, etc.
    Task: Imagine you have program that has some menu items grayed. This prevents your user from accessing some advanced features available to full version owners. I was wondering if it will allow me to use these features if I enable grayed items from external program. It was easy to find all calls to disable function and replacing them with NOP (0x90).

  4. #4
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    possibly...why don't you try it?

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    You want to break into shareware / demo software and steal access to full version functions.

    So you don't have to pay people like me for their work.

    And you want people like me to tell you how to do it.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186
    And why would you include all the features of a program in a demo and assume that simply greying out a menu option would provide protection against a determined analytical mind? Unless, of course, the demo is on a timed basis, in which case you can disregard that entire statement.
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  7. #7
    Registered User
    Join Date
    Jan 2002
    Posts
    7
    Hey, people, don't think that I'm trying to crack some program with your help. Remember that real cracker never ask questions.
    Sometimes I hear very clever explanations on how programs are working. So what I wanted is to get deeper understanding what happen if grayed out menu item will be reenabled externally? Will it reenable function that is behind this menu item?
    As well as many of you I'm writing and selling programs so stealing someone's money is not my way of getting credits.


  8. #8
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    >>Will it reenable function that is behind this menu item?

    Yes, a message that could not be generated due to the ctrl being disabled will now flow to the callback.
    In my code the function would check your access level and then kick you out again.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Immediate programming help! Please!
    By xMEGANx in forum C++ Programming
    Replies: 6
    Last Post: 02-20-2008, 12:52 PM
  2. Retail Outlet Managment System - the 4th
    By Presidentofusa in forum C Programming
    Replies: 3
    Last Post: 11-10-2007, 10:44 PM
  3. Constructive Feed Back (Java Program)
    By xddxogm3 in forum Tech Board
    Replies: 12
    Last Post: 10-10-2004, 03:41 AM
  4. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM