Hello everyone, I posted a message a couple weeks ago about writing menus. Now I would like to know how to link menu items to programs and windows like the open, save, save as windows and do stuff like select, delete, copy, paste (if anyone could tell me how to write the code for the select, copy, paste, delete stuff that would be great too!). My menu looks like this:
MENU
BEGIN
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-07-10
You seem to be asking very basic questions about Win32 GUI programming, and getting your information this way will result in very slow progress. Get yourself some Win32 reference material (such as Petzold's Win32 Programming) where this will certainly be covered.
Basically selecting menu item results in a WM_COMMAND message being passed to your program's message loop. When this occurs, the wParam parameter contains the menu ID as specified in the resource (IDM_FILESAVE for example). You write your message loop to check for WM_COMMAND and then call an appropriate handler (or inline the handler code) depending on wParam. An example can be found at http://omnimaga.org/ar/t1124.htm for example (I just Google'd "IDM_FILESAVE" to find that example, I am not suggesting that it is a good or bad example - find your own its that easy!)
There are also a number of examples provided with Dev-C++!
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone, I posted a message a couple weeks ago about writing menus. Now I would like to know how to link menu items to programs and windows like the open, save, save as windows and do stuff like select, delete, copy, paste (if anyone could tell me how to write the code for the select, copy, paste, delete stuff that would be great too!). My menu looks like this:
MENU
BEGIN
END
Thank you!
You seem to be asking very basic questions about Win32 GUI programming, and getting your information this way will result in very slow progress. Get yourself some Win32 reference material (such as Petzold's Win32 Programming) where this will certainly be covered.
Basically selecting menu item results in a WM_COMMAND message being passed to your program's message loop. When this occurs, the wParam parameter contains the menu ID as specified in the resource (IDM_FILESAVE for example). You write your message loop to check for WM_COMMAND and then call an appropriate handler (or inline the handler code) depending on wParam. An example can be found at http://omnimaga.org/ar/t1124.htm for example (I just Google'd "IDM_FILESAVE" to find that example, I am not suggesting that it is a good or bad example - find your own its that easy!)
There are also a number of examples provided with Dev-C++!
Clifford