WM_KEYDOWN and the F10 key (non MFC app)

I need to catch function key presses in a windows application (c++ non mfc, NT4).

WM_KEYDOWN works fine for all the F keys apart from F10 becuase windows intercepts this key and sends a WM_SYSCOMMAND to activate the system menu on the window.

Is there any way I can prevent windows doing this so that I can handle the F10 key press myself in the same way I handle all the other function keys?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The F10 keys sends a WM_SYSKEYDOWN instead of WM_KEYDOWN.  The purpose of this is to confuse you.  It seems to have worked.

Just handle this message.  If it is for the F10 key, treat it as you would like, don't pass it to the default window procedure.  The derfault window procedure will send a WM_SYSCOMMAND in response to WM_SYSKEYDOWN for the F10 key.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
F10 sends WM_SYSKEYDOWN because it _is_ a system key; it sets keyboard focus to the menu, just like pressing and releasing ALT without pressing another key in combination.

Windows has worked this way since Version 1.0.  OS/2 works the same way.

..B ekiM
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.