Hi, I want to make an "auto log in" program for my gmail account. I have it so that you can input a username and a password, it will encrpyt them, and save them in a text document. Then if you want to, it will run a program that will open "www.gmail.com". It copies my username into the clipboard, and I want it to paste it there. The thing is, the webpage isn't in my console window (obviously), so I don't know how to make it paste the information to where I desire it ...
This is the code for opening the webpage ... so if anyone could add something to it to paste the username and password to the right place, it'd be great!!!!!!!
Thanks!!!!PHP Code:
[CODE]# include<fstream>
# include<iostream>
# include<string>
# include<conio.h>
# include<tchar.h>
# include<time.h>
# include<windows.h>
using namespace std;
BOOL SetClipboardText(LPCTSTR pszText)
{
HGLOBAL hGlobal;
int nBytes;
LPTSTR pClipboardData;
unsigned int format;
#ifdef UNICODE
format = CF_UNICODETEXT;
#else
format = CF_TEXT;
#endif
if(!OpenClipboard(NULL))
return FALSE;
EmptyClipboard();
nBytes = (_tcslen(pszText) + 1) * sizeof(TCHAR);
hGlobal = GlobalAlloc(GMEM_MOVEABLE,nBytes);
if(!hGlobal)
{
CloseClipboard();
return FALSE;
}
pClipboardData =(char*) GlobalLock(hGlobal);
if(!pClipboardData)
{
CloseClipboard();
return FALSE;
}
memcpy(pClipboardData,pszText,nBytes);
GlobalUnlock(hGlobal);
SetClipboardData(format,hGlobal);
CloseClipboard();
return TRUE;
}
int main()
{
int minutes;
char address[50]=" ", key;
cout<< "\nWhat wep page do you want to go to??"
<< "\n\n\t"
<< (char)0x1a;
for (int i=0; i<50; i++)
{
key = getch();
if ( (char)key == 13 )
{
break;
}
else if ( (char)key == 8 )
{
if ( i == 0 )
{
cout<< NULL;
}
else
i--;
address[i]=NULL;
cout<< (char)8
<< (char)0
<< (char)8;
i--;
}
else
{
cout<< key;
address[i]=key;
}
}
else if (minutes == 0)
ShellExecute(NULL, "open", address, NULL, NULL, SW_SHOWNORMAL);
SetClipboardText("[email protected]");
//Need something to paste the username
system ("PAUSE");
SetClipboardText("This isn't a password!!");
//Need something to paste the password
system ("PAUSE");
return 0;
}[/CODE]
Twomers
EDIT: whoops, forgot: Windows XP and Microsoft Visual C++