Results 1 to 3 of 3

Thread: best way to send Ctrl+C to the os?

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    best way to send Ctrl+C to the os?

    I'm working on a program that i need to copy and paste while not in focus

    I have the code to register global hotkeys (ctrl+1 ctrl+2 etc) but i want to trigger a copy or paste when the hotkey is triggered

    I'm not sure what the best way is to send a keystroke to the os is

    any ideas or hits?

    Thanks so much

  2. #2
    Addicted Member
    Join Date
    Nov 2006
    Location
    Minnesota
    Posts
    235

    Re: best way to send Ctrl+C to the os?

    What exactly are you trying to do? Are you trying to send or receive from the Clipboard?
    Code:
    String TextFromClipboard =  Clipboard.GetText();
                Clipboard.SetText("Clipboard Text");
    If someone has helped you, please make sure to rate them.

  3. #3
    Addicted Member Phreak's Avatar
    Join Date
    Oct 2005
    Location
    Netherlands
    Posts
    132

    Re: best way to send Ctrl+C to the os?

    To send a keystroke use, 'SendKeys'

    Send the keystroke ctrl+c
    Code:
    SendKeys("^C");
    For more information about SendKeys checkout;
    link
    If i gave you good code/help, then dont forget to RATE
    Dont forget to mark your thread [Resolved] with the tools from the menu above...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width