Subj : Re: CTRL key To : borland.public.cpp.borlandcpp From : mike Date : Fri Jul 16 2004 09:29 pm > Are you trying to create a shortcut in your menu bar? If so then the code > would look something like this... This is exactly what i'm trying to do. however the & is for the ALT key. my menu is setup like this in my resource file (see below). pressing CTRL-A doesn't do anything. however if i press ALT-F to activate the File Menu and then i press 'a', i get the action as if i clicked File->Add. MYMENU MENU { POPUP "&File" { MENUITEM "&Add...\tCtrl-A", ID_FILE_ADD_MENU MENUITEM "&Modify...\tCtrl-M", ID_FILE_MODIFY_MENU MENUITEM "&Delete\tCtrl-D", ID_FILE_DELETE_MENU MENUITEM "&Save\tCtrl-S", ID_FILE_SAVE_MENU MENUITEM SEPARATOR MENUITEM "&Generate CSV file\tCtrl-G", ID_FILE_CSV_MENU MENUITEM "&Print\tCtrl-P", ID_FILE_PRINT_MENU, GRAYED MENUITEM SEPARATOR MENUITEM "E&xit\tAlt-F4", ID_FILE_EXIT_MENU } } > case WM_CREATE: > { > HMENU hMenu, hSubMenu; > hMenu = CreateMenu(); > hSubMenu = CreatePopupMenu(); > AppendMenu(hSubMenu,MF_STRING,ID_FILE_EXIT,"E&xit"); > AppendMenu(hMenu,MF_STRING|MF_POPUP,(UINT)hSubMenu,"&File"); > SetMenu(hwnd,hMenu); > } > This would create a menu that uses CTRL+x to as a shortcut to exit the > program and CTRL+F to open a file. Hope this helps you out. This uses the ALT key and not the CTRL key. aloha, mike .