• Advertisement
Sign in to follow this  

how to receive Ctrl-C message

This topic is 4919 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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,

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement