Help me with ShellExecute

Hello, i want make login and password in facebook with a program in c++. Help me!!! Look my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
#include <string>
#include <windows.h>

using namespace std;

int main()
{
   string enter;
   string login;
   string password;

   cout << "Login: ";
   getline(cin, login);
   cout << "password: ";
   getline(cin, password);

   enter = "http://www.facebook.com/login.php?login_attempt=1&lwv=110";

   ShellExecute(NULL, "open", enter.c_str(), "", NULL, SW_SHOWNORMAL);

   return 0;
}
Last edited on
It can't be done like this. I don't believe there are any browsers that will accept strings over the command line and use them for login over HTTPS.

If it's to interact with an existing browser, a solution would have to consist of two parts:
1. A browser extension for a browser opens an IPC channel and listens for connections from other local processes. When it receives a connection and data, it uses this data to contact the website and start the login process, whatever this may entail.
2. A separate program accepts user input, connects to the IPC channel, and sends the data over the channel.

I think it would probably be simpler to just do everything in the browser extension, although it may not be useful, depending on the specific problem you're trying to solve.
Topic archived. No new replies allowed.