none
Pass selected text with F9 or another function key from any application to C# application RRS feed

  • Question

  • Hi,

    I would like to program a phone dialer to select a phone number in any application, and with a keypress, F9 for example, pass it to a little C# application. The application interfaces with the PBX to automaticly dial the number for the user. 

    What solution can i use to pass a selected text from any application to the C# application?

    Twan.

    Wednesday, February 20, 2019 4:05 PM

All replies

  • Hi, 

    Thank you for posting here.

    Based on my search, I could not find a way to get the selected text with F9 from any application.

    Best regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Monday, February 25, 2019 8:13 AM
    Moderator
  • In a sense, a mechanism already exists. It's called copy/paste.

    This is a technique that should be familiar to all users of computers and gives the user full control over what, exactly is copied and pasted.

    Providing an alternative, more 'automatic', way is unlikely to work in any general sense, because its up to each individual application to decide what keypresses should do and should not do within that application. No application would want some other application to come along and hijack certain keypresses and no operating system should make such an operation possible (or at least, I would expect it to make it as hard as possible) due to security concerns.

    Having said all that, you may want to explore a macro program, i.e. sending keystrokes to a program to trigger a 'copy' function (though this would still require each program to use the same keystrokes to trigger a copy). E.g. using the SendKeys class.
    • Edited by RJP1973 Monday, February 25, 2019 4:16 PM
    Monday, February 25, 2019 4:12 PM