Click here to Skip to main content
11,711,750 members (79,491 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C#3.5
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.

thanks
EdgeCat
Posted 30-Jan-13 1:06am
Unikoon340

1 solution

Rate this: bad
good
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
  Permalink  

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

  Print Answers RSS
0 CHill60 280
1 Sergey Alexandrovich Kryukov 264
2 OriginalGriff 170
3 Andy Lanng 160
4 Richard MacCutchan 130
0 CHill60 280
1 Sergey Alexandrovich Kryukov 125
2 Andy Lanng 120
3 Abhinav S 95
4 Maciej Los 95


Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2015
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