I am new to programming and am trying to learn by studying the examples. I have tried to add a seperator and "SelectAll" to the Edit menu in the WinMenu Example. I still can't figure out how to do this. Please help. When I attempt to add the item to the rc file or the source code and try to compile & run it, the compiler tells me that there are errors. Any ideas?
Randal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if you are new you need to add th resource to it in a resource file
so with this in the .h file add this
#define IDMENU 1001
#define ID_EXIT 1002
in the rsrc.rc file
IDMENU MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "menu", IDC_MENU //<----- resource
END
END
the resource is often placed into a Res file and called though #include "resource.h" etc
in the .c file there should be this lot of declares
wincl.hInstance = hThisInstance; // this instance
wincl.lpszClassName = szClassName; // class name
wincl.lpfnWndProc = WindowProcedure; // where to
// for
//procedure
wincl.style = CS_DBLCLKS; // catch D clicks
wincl.cbSize = sizeof(WNDCLASSEX); // how big
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION); // icon
/* to use*/
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
/* same as above*/
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
/* what cursor*/
wincl.lpszMenuName = NULL;
// and finally the menu commnad
// change this to
// wincl.lpszMenuName = GETMENUITEM(IDMENU);
wincl.cbClsExtra = 0
wincl.cbWndExtra = 0
wincl.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
/* Register the window class, if fail quit the program */
if(!RegisterClassEx(&wincl)) return 0;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am new to programming and am trying to learn by studying the examples. I have tried to add a seperator and "SelectAll" to the Edit menu in the WinMenu Example. I still can't figure out how to do this. Please help. When I attempt to add the item to the rc file or the source code and try to compile & run it, the compiler tells me that there are errors. Any ideas?
Randal
if you are new you need to add th resource to it in a resource file
so with this in the .h file add this
#define IDMENU 1001
#define ID_EXIT 1002
in the rsrc.rc file
IDMENU MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "menu", IDC_MENU //<----- resource
END
END
the resource is often placed into a Res file and called though #include "resource.h" etc
in the .c file there should be this lot of declares
wincl.hInstance = hThisInstance; // this instance
wincl.lpszClassName = szClassName; // class name
wincl.lpfnWndProc = WindowProcedure; // where to
// for
//procedure
wincl.style = CS_DBLCLKS; // catch D clicks
wincl.cbSize = sizeof(WNDCLASSEX); // how big
wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION); // icon
/* to use*/
wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
/* same as above*/
wincl.hCursor = LoadCursor(NULL, IDC_ARROW);
/* what cursor*/
wincl.lpszMenuName = NULL;
// and finally the menu commnad
// change this to
// wincl.lpszMenuName = GETMENUITEM(IDMENU);
wincl.cbClsExtra = 0
wincl.cbWndExtra = 0
wincl.hbrBackground = (HBRUSH) GetStockObject(LTGRAY_BRUSH);
/* Register the window class, if fail quit the program */
if(!RegisterClassEx(&wincl)) return 0;