Jump to content

C++ Copy/Paste


Blopa

Recommended Posts

Hello there forum, I have recently been working on encryption software (I'm an amateur in everything, just starting my physics studies, but I'm doing my best).

 

I've been building it on C++ (specially with Dev-C++), I'm using "the black screen" for everything, and I was wondering if any of you knew an useful script that allows the black screen to "paste" a string copied from somewhere else (like when you copy a text from somewhere and then simply 'paste' it on Word) and also another one to "copy" a desired string so it can be easily pasted somewhere else.

 

-Thanks for your time, Blopa

Link to comment
Share on other sites

By "the black screen" you mean the console? In Linux, you'd mark the text, then move to the location you want it to appear, and press the middle mouse button to insert it there. If that doesn't work for Windows, I can imagine that there's ways to configure it to behave that way or plugins that can be downloaded.

Link to comment
Share on other sites

Exactly, I meant the console, but in windows that one doesnt works, also to copy paste you must right click and make many process to copy and paste, I want to make something like that the user inputs "/c" "/v" and the program automaticly copies or pastes the information

Link to comment
Share on other sites

In windows right click on the console and choose MARK. Highlight the selection you wish to copy and press enter, this will store the text to clipboard and you can then paste it wherever. If you wish to paste from clipboard onto the prompt you must right click and choose PASTE there are no other solutions as far as I am aware as ctrl-v does not work ..... :/

Link to comment
Share on other sites

I can imagine that if you find a way to access the clipboard history, you can take data from there and output to the screen when you press a certain key combination, which you define yourself.

 

I can be wrong, but Dev C++ doesn't seem to have been updated in quite a few years. If you're sticking to Windows programming and are not too worried about portability at this time, I would strongly suggest getting Visual C++ Express. That way, you can also make use of the clipboard functions here:

 

http://msdn.microsoft.com/en-us/library/ms648709(VS.85).aspx

 

Visual C++ Express is a slimmed down version of Visual Studio. But for all intents and purposes, it should work for you.

 

http://www.microsoft.com/express/Downloads/#2010-Visual-CPP

Link to comment
Share on other sites

This really isn't something that would happen rather quickly and in a few lines of code. If approached from standard Windows programming methodology then there isn't a means to inject external to the console executable binary, you must modify the source code and recompile. This means that essentially you will have a new console separate from all the rest and if you are to use any of the others your modifications won't apply. A far stretch might be to say that, if maybe if you create a server that monitors your system for active consoles and intercept their callbacks, you could essentially create a transparent window layer that aggregates your I/O and have it do the MARK, COPY and PASTE for you :/

Edited by Xittenn
Link to comment
Share on other sites

  • 4 months later...

Copy\Paste thing does not exist in systems core, or terminals .. but there are two ways:

 

1. use special library for the Operating system you are using (Code will be limited to the OS)

 

2. create a new application in the system (you can write), to work as a Copy Pad that works on the terminal

 

.. good luck

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.