Free 14-Day Evaluations    
Product Downloads    

Sign in     


DESKTOP MOBILE DOWNLOAD PURCHASE SUPPORT INFO COMPANY
 Home  >>  Support  >>  Knowledge Base

Removing Menu Items in TinyTERM 4

TinyTERM includes a sample script called noprefs.cs. This allows you to remove the Preferences item from the Edit menu. But what if you want to remove more items from the menus? Where are the MENUITEM numbers listed?

You don’t actually have to use the MENUITEM number to remove a menu item. If you’ll take a look at the first RemoveMenuItem() command in the script noprefs.cs, it does its work entirely by position:

RemoveMenuItem( GetSubMenu( hMenu, 1 ), 3 , 1024 );

The first parameter, GetSubMenu( hMenu, 1), is the menu number of menu index 1, the Edit menu. The menus are indexed from left to right, with the first menu (File) being index 0. So you can use GetSubMenu(hMenu,3) to indicate the Tools menu, for example.

The second parameter, 3, is the index number of the menu item. Again, these are indexed starting at 0. Item 3 in the sample script is the separator bar on the Edit menu. It’s actually a separate menu item, though you can’t click it.

The third parameter, 1024, is an internal command which tells RemoveMenuItem() to delete by position index instead of by actual number. This is required when using RemoveMenuItem() in this fashion.

Please note that removing one item reindexes every item below it. So if you remove item 3, the next item down becomes item 3, etc. When removing menu items in this fashion, it’s best to remove them from the bottom up.

Comments are closed.

  Copyright © 2024 Century Software, Inc. All Rights Reserved999 TERMS OF USE PRIVACY POLICY EULA