Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 76485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:40:51+00:00 2026-05-10T20:40:51+00:00

I have a windows application running at the backend. I have functions in this

  • 0

I have a windows application running at the backend. I have functions in this applications mapped to hot keys. Like if I put a message box into this function and give hot key as Alt+Ctrl+D. then on pressing Alt, Ctrl and D together the message box comes up. My application is working fine till this point.

Now I want to write a code inside this function so that when I am using another application like notepad, I select a particular line of text and press the hot key Alt + Ctrl + D it is supposed to copy the selected text append it with ‘_copied’ and paste it back to notepad.

Anyone who has tried a similar application please help me with your valuable inputs.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:40:51+00:00Added an answer on May 10, 2026 at 8:40 pm

    Your question has two answers

    How can my app set a global hotkey

    You have to call an API funcion called RegisterHotKey

    BOOL RegisterHotKey(     HWND hWnd,         // window to receive hot-key notification     int id,            // identifier of hot key     UINT fsModifiers,  // key-modifier flags     UINT vk            // virtual-key code ); 

    More info here: http://www.codeproject.com/KB/system/nishhotkeys01.aspx

    How to get the selected text from the foreground window

    Easiest way is to send crl-C to the window and then capture the clipboard content.

    [DllImport('User32.dll')]  private static extern bool SetForegroundWindow(IntPtr hWnd);  [DllImport('user32.dll', CharSet=CharSet.Auto)] static public extern IntPtr GetForegroundWindow();  [DllImport('user32.dll')] static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo);   .....  private void SendCtrlC(IntPtr hWnd)     {     uint KEYEVENTF_KEYUP = 2;     byte VK_CONTROL = 0x11;     SetForegroundWindow(hWnd);     keybd_event(VK_CONTROL,0,0,0);     keybd_event (0x43, 0, 0, 0 ); //Send the C key (43 is 'C')     keybd_event (0x43, 0, KEYEVENTF_KEYUP, 0);     keybd_event (VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);// 'Left Control Up  } 

    Disclaimer: Code by Marcus Peters from here: http://bytes.com/forum/post1029553-5.html
    Posted here for your convenience.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application which is .NET 2.0, running on Windows XP Professional. This
I have an application running only on Windows and a batch file that launches
I have a .net 3.5 application running on windows mobile professional that uses sql
I have a wcf application hosted in a windows service running a local windows
More particularly - I have a window handle of another running application. This application
I have my Windows Application that accepts args and I use this in order
I have a WCF service that is called by a Windows Mobile application running
I have an external Windows .exe that is actually Java application: Running the .exe
I have a fullscreen application running on Windows CE 6.0 which will only be
I have a WPF 4 application running on Windows XP. When I run Snoop,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.