Click here to Skip to main content
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 2:06am
Unikoon329

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 OriginalGriff 195
1 Afzaal Ahmad Zeeshan 152
2 ProgramFOX 130
3 Maciej Los 130
4 den2k88 80
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,657
4 Maciej Los 4,150


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