Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-10-2008, 06:09 AM   #1
Registered: Jun 2004
Posts: 236

Rep: Reputation: 33
Copy to Clipboard

Using either C or C++, how do you copy to clipboard and probably paste whilst were at it please?
Old 02-10-2008, 08:09 AM   #2
Registered: Aug 2005
Posts: 330

Rep: Reputation: 32

This seems to work if you're looking for a windows solution.
Old 02-10-2008, 09:21 AM   #3
Registered: Jun 2004
Posts: 236

Original Poster
Rep: Reputation: 33
yes, i've found that for windows the functions are in user32.dll (GetClipboardData, SetClipboardData, etc), but I am after linux capability (must be somewhere cos most standard apps use it!). I was origionally looking to use it with the irrlicht library, yet they actually seem to have it already, but on closer inspection it may just be for win (also have libs for mac). Also i've found some ref's in doc's for MiniGUI which is nix...

Old 02-10-2008, 09:24 AM   #4
Registered: Jun 2004
Posts: 236

Original Poster
Rep: Reputation: 33
Wine has users.c and cygwin seems to have library somewhere...
Old 02-10-2008, 09:49 AM   #5
Registered: Jun 2007
Location: Bavaria
Distribution: slackware, xubuntu
Posts: 143

Rep: Reputation: 22
Hi there rubadub ...

under Linux you'll find (unfortunately) two (or more ?) different solutions. Unfortunately in the sense that there will be differences between applications, unless it implements several options.
For now I'll just list the two I know and leave it up to you - or maybe someone else will chip in - to google/decide what's best for you. Both are feasible with core X11 functions.

1) cut buffers (easiest but kinda old)
2) selections (more reliable)
Old 02-11-2008, 02:39 AM   #6
Registered: Jun 2004
Posts: 236

Original Poster
Rep: Reputation: 33
Cheers for that fantas, upon researching (a little) it 'is' said that 'cut buffers' shouldn't be used any more in favour of the 'selections' method described by the ICCCM documents. However at this time I haven't the time (8.39am), so once again TBC...



clipboard, copy, paste

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy an entire document in Vi to clipboard geokker Linux - Newbie 2 08-06-2009 03:14 PM
Copy Clipboard Between Windows XP and Ubuntu Machine OnoTadaki Linux - Software 4 10-31-2007 09:56 AM
Copy screenshot to clipboard simbamford Linux - Newbie 1 11-24-2006 03:17 PM
copy from terminal to clipboard curos Linux - Newbie 2 02-04-2006 09:39 AM
how do I copy a selection from xterm to clipboard? hollywoodb Linux - Newbie 1 10-06-2003 12:43 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration