Is it possible for KeyPress events in MFC?

I've been looking around for a good tutorial that deals with the KeyPress event handler for MFC VC++. I only see WM_OnKeyDown events. Are they the same? I want to be able to use the keyboard numbers in my editControl boxes. The MSDN isn't much help unfortunately. Thanx In Advance!!!

Staff: Mentor

By number keys do you mean F1 - that returns two numbers.
Regular ascii keys return like 48 or '0' to the message pump when the zero key is pressed.
It is a pointer to a value: const Key* Key is a datatype in windows.h, as is bool
You get either TRUE or FALSE when you test with these functions.

By number keys do you mean F1 - that returns two numbers.
Regular ascii keys return like 48 or '0' to the message pump when the zero key is pressed.
It is a pointer to a value: const Key* Key is a datatype in windows.h, as is bool
You get either TRUE or FALSE when you test with these functions.

Thanks a lot for the help. I guess I need to do more reading on MFC to understand how exactly to use and write these functions. For me, sometimes MSDN is jibberish. LOL! Sometimes I feel overwhelmed with all of the information. Anyway, should I test your code in a WM_OnKeyUp function or in another function, or does it depend on my program? Thanks Again!!!

Staff: Mentor

There's a lot to it. Your object has to have focus to receive events, for starters.
And you do NOT have to use MFC - which I found to cause as many issues as it solved.
Get a copy of Charles Petzold's Programming Windows - the one for Windows 98 and on.
http://books.google.com/books?id=7msBAAAACAAJ&dq=inauthor:Charles+inauthor:Petzold [Broken]

No offense meant, but I think you need to start at the beginning. Instead of inside MFC.

There's a lot to it. Your object has to have focus to receive events, for starters.
And you do NOT have to use MFC - which I found to cause as many issues as it solved.
Get a copy of Charles Petzold's Programming Windows - the one for Windows 98 and on.
http://books.google.com/books?id=7msBAAAACAAJ&dq=inauthor:Charles+inauthor:Petzold [Broken]

No offense meant, but I think you need to start at the beginning. Instead of inside MFC.

True to a certain extent. I just learn and understand better with examples. Unfortunately I'm learning this on my own so it's taking me a while. I'm working on a Fraction Calculator which is basically complete. I still have a few things to workout such as, giving the user the option to input everything via the keyboard instead of just clicking all the buttons for input. Basically making it more user friendly.