General discussion

Locked

Windows controls and keyboard handling

By avhohlov ·
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

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by ytvsoftware In reply to Windows controls and keyb ...

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.

Back to Web Development Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums