Click here to Skip to main content
13,551,001 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi Developers
I have developed an application in C# 3.5 which I want to get clipboard data into one of its' text box.

Once a user copy URL in his web browser, this application must be able to take that copied URL in to that textbox from the clipboard without user involvement to paste.

please give me an idea or code to achieve this.

Posted 30-Jan-13 1:06am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

1) You will have to monitor clipboard activity[^]. As I see, you will have to use P/Invoke, since there are no tool for that in the framework.
On every detected change you have to do following:
2) check the content of the clipboard for text format
3) get the active window and check if it is a browser - you could omit this constraint
3) validate the text from the clipboard for url syntax
4) give the value to the textbox

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.180515.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100