Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Notepad

Status
Not open for further replies.

rann

Programmer
Sep 13, 2001
86
US
Hi,
I am new to API.

I would like to know if we can disable the menu options
in windows applications such as Notepad, Solitare game
using API calls.

For Example i would open notepad from my vb application
(which is easy) i need to disable the File->open menu option using API as i open notepad.

Any help, Tips, suggestions would be helpfull.

Thanks in Advance,

Rann
 
Hi Rann,

Yes you can do it.

- First, you have to find the window handle
- Then use GetMenu(hWnd) to get the menu handle
- Get the submenu from that menu using GetSubMenu
- Get the item ID (menu item) from the submenu using GetMenuItemID.
- Then use EnableMenuItem with MF_BYCOMMAND+MF_DISABLED+MF_GRAYED for the parameter

Hope it helps

-- AirCon --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top