Discussion Locked

Windows controls and keyboard handling

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have Win32 application with main window (WndPros - it's window procedure) and some child controls in it (EDIT's, BUTTON's, my own controls). All windows are created by CreateWindow calls. What is correct way to handle UpArrow/DownArrow/PgUp/PgDn/Tab and some other keys presses in WndProc when one of child controls (EDIT, for example) has input focus?
Now I use translation of WM_KEYDOWN to WM_COMMAND in message loop (GetMessage/My Translation/TranslateMessage/DispatchMessage).How I can handleWM_KEYDOWN directly in WndProc?
Thanks

1 reply

by ytvsoftware

It is not quite clear what you mean writting that Edit is you own controls. You developed them
as your windows or it is from MS library. Any way if it is from the standard library create your class derived from those controls. Then you need provide information that your control accepts all characters. Look in help for VC++.
Then subclass your controls so you will intercept the characters. Then just use PostMessege(...,WM_COMMAND,...,...) function in your translation subroutine.

This discussion is closed to new replies.