- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I have an SDI application that uses one edit control as simple file viewer. I have associated the key combination Ctrl+C as short cut key with the "copy" menu entry. I use "LoadAccelerators" to load the accelerator table and I use "TranslateAccelerator" in the message loop.
The menu entry for copy does what it has to do and so does the standard short cut for copy (ctrl+insert). But the short cut I defined (ctrl+C) doesn't function. In fact none of the short cut keys I associated to menu entries in the accelerator table do what they should do.
Any ideas? Thanks,
Walter Kramer
The menu entry for copy does what it has to do and so does the standard short cut for copy (ctrl+insert). But the short cut I defined (ctrl+C) doesn't function. In fact none of the short cut keys I associated to menu entries in the accelerator table do what they should do.
Any ideas? Thanks,
Walter Kramer
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TranslateAccelerator as the first argument has handle of the window accelerator is intended for. I assume that you have in the message
loop:
instead, replace it with
IF (.NOT.TranslateAccelerator(hFrame, hAccelTable, Mesg)) THEN
...
and it should work OK (hFrame is apparently the handle of the frame window). The other way, WM_COMMAND goes to the edit control, which neither handles it nor passes it to its parent window.
HTH
Jugoslav
loop:
IF (.NOT.TranslateAccelerator(Mesg%hWnd, hAccelTable, Mesg)) THEN iSt=TranslateMessage(Mesg) iSt=DispatchMessage(Mesg) END IF
instead, replace it with
IF (.NOT.TranslateAccelerator(hFrame, hAccelTable, Mesg)) THEN
...
and it should work OK (hFrame is apparently the handle of the frame window). The other way, WM_COMMAND goes to the edit control, which neither handles it nor passes it to its parent window.
HTH
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you are as always right.
Thank you,
Walter
Thank you,
Walter

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page