how to receive Ctrl-C message

Started by
1 comment, last by Emmanuel Deloget 19 years, 7 months ago
hi all : i can easily receive Ctrl-X (cut), Ctrl_C (Paste) notify via WM_CHAR message in a program created with UNICODE defined, but why i can not receive them no more when the same program compiled without UNICODE defined? thanks.
Advertisement
Are these characters part of the ASCII set? They might not be, and if they aren't, they can't come in a single message. You can, however, catch presses of ctrl and c seperatly.
The better solution is probably to use accelerators. You will then generate separate messages (ID_COPY, ID_PASTE, everything you want).

If you don't want to do that, you can test your character key in the WM_CHAR handler, then call GetAsyncKeyState(VK_CONTROL) to know wether the control key is up or down.

As MSDN states :

Quote:
The TranslateMessage function generates a WM_CHAR message when the user presses any of the following keys:

  • Any character key
  • BACKSPACE
  • ENTER (carriage return)
  • ESC
  • SHIFT+ENTER (linefeed)
  • TAB



HTH,

This topic is closed to new replies.

Advertisement