Sign in to follow this  
Slug

Internet question...

Recommended Posts

Slug    100
Hi, i wanna know if they're is a way to do this: Right-click on something on internet Choose "Save target as..." Press Enter By pressing a button, for example... I don't kwow what's the code in need to achieve that(in C++) Anybody can help?

Share this post


Link to post
Share on other sites
Zahlman    1682
"Scripting" existing programs is possible, to a certain extent, depending on your operating system; but it's generally nothing to do with language features, but instead stuff that the OS provides to you (an "API" - application programming interface - which is to say, a library you can include in your program to let it do the necessary stuff. In C or C++, on Windows, this is the header <windows.h>.), and of course it depends what the other program will *let* you do :)

It isn't necessarily easy, or even possible for any *specific* task, though.

On the other hand, you might have better luck making a program that just accepts a URL as input, looks up the file and saves it to disk (for simplicity, make it grab the last part of the slash-path as the filename to use, and save in the same directory as the program). This won't be particularly easy in C++, although it's certainly possible (and probably easier than scripting your web browser). It's an ideal task for Python, however.

Share this post


Link to post
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

Sign in to follow this