-
August 5th, 2014, 12:31 AM
#1
controlling some file by C-programme
Hi!
I need to open a pdf file (I used system("file_name.pdf"), and it worked). Next is that I want to copy complete content of the file (I want to execute ctrl+a). I want to give this command through my C program, then I will get the content of the windows clipboard having all the copied content.
Please help me regarding this. (C/C++/VC, all solutions acceptable)
Thank you in advance.
#include <stdlib.h>
#include <stdio.h>
int main(){
/* opening a file */
system("results.pdf");
///////////////////////////////////////////////////////
/////copy the content in file (execute ctrl+a)/////
////// ------------------------------------- ////
///////////////////////////////////////////////////////
return 0;
}
-
August 5th, 2014, 03:19 AM
#2
Re: controlling some file by C-programme
Why do you need to "get the content of the windows clipboard having all the copied content"? What are you going to do with it?
What if the file would be very big and your ctrl+a failed?
...
So what is the main goal of your "C-programme"?
Victor Nijegorodov
-
August 5th, 2014, 03:42 AM
#3
Re: controlling some file by C-programme
Originally Posted by VictorN
Why do you need to "get the content of the windows clipboard having all the copied content"? What are you going to do with it?
What if the file would be very big and your ctrl+a failed?
...
So what is the main goal of your "C-programme"?
Actually I want to copy content of any file by my program. I have come to know a solution, I can send keyboard event to that file after opening it.
-
August 5th, 2014, 03:45 AM
#4
Re: controlling some file by C-programme
I have tried command prompt command also but failed in case of pdf.
clip < file_name
It does not copy pdf file's content.
-
August 5th, 2014, 03:58 AM
#5
Re: controlling some file by C-programme
If your orgram is about to run on Windows computers then why not using Windows API like CopyFile or CopyFileEx?
Victor Nijegorodov
-
August 5th, 2014, 04:06 AM
#6
Re: controlling some file by C-programme
Thanks for the suggestion. I will definitely try it once my office is over.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|