Picking up CTRL + C

This is a discussion on Picking up CTRL + C within the Windows Programming forums, part of the Platform Specific Boards category; Sorry to be brief, but how can I get my program to run a function when the user hits CTRL ...

  1. #1
    Confused
    Join Date
    Nov 2002
    Location
    Warwick, UK
    Posts
    209

    Picking up CTRL + C

    Sorry to be brief, but how can I get my program to run a function when the user hits CTRL + C, and thus not have to constantly monitor the clipboard for change ? I know nothing whatsoever about Windows messages and such, but I've been told I need to use a certain WM_something, but have no idea which or how.
    Thanks for any help.

  2. #2
    Registered User trainee's Avatar
    Join Date
    Jan 2004
    Posts
    32
    Interesting question. I want to know this too please, .

    trainee

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,699
    Last edited by Codeplug; 01-07-2004 at 02:55 PM.

  4. #4
    Registered User trainee's Avatar
    Join Date
    Jan 2004
    Posts
    32
    Thanks a bunch codeplug, but the second link isn't valid.

    trainee

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,699
    ooops, fixed it.

    gg

  6. #6
    Confused
    Join Date
    Nov 2002
    Location
    Warwick, UK
    Posts
    209
    Thanks for your reply, Codeplug... Do you have any quick source codes showing how a program can run a function when CTRL + C has been pressed ? I'm still having trouble with this and have no idea where to start. Sorry
    Thanks.

  7. #7
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,699
    An application is free to implement cut/copy/paste on any key-stroke they want.
    What about "Edit menu -> cut/copy", or "right-click -> cut/copy" functionality?

    That's why I posted the link to WM_PASTE.

    Read the article on Win32 hooks, specifically for WH_GETMESSAGE so you can monitor for WM_PASTE messages in the system.
    When you detect a WM_PASTE message you can analyse the contents of the clipboard and make modifications before WM_PASTE reaches it's target window.

    There are examples of using hooks on MSDN.

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 07-02-2007, 01:32 AM
  2. Picking: not working properly
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 09-06-2005, 06:18 PM
  3. how to capture CTRL, SHIFT and ALT ?
    By goldenrock in forum C Programming
    Replies: 3
    Last Post: 11-06-2003, 01:20 AM
  4. Trapping Ctrl Alt Delete
    By emus21 in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 09-17-2003, 01:10 PM
  5. Ctrl + Alt +Delete
    By golfinguy4 in forum Windows Programming
    Replies: 4
    Last Post: 10-27-2002, 07:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21