Thread: auto log in program ....

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273

    auto log in program ....

    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!!!!!!!

    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=0i<50i++)
        {
            
    key getch();
            if ( (
    char)key == 13 )
            {
                break;
            }
            else if ( (
    char)key == )
            {
                if ( 
    == )
                {
                    
    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"addressNULLNULLSW_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
    Thanks!!!!

    Twomers

    EDIT: whoops, forgot: Windows XP and Microsoft Visual C++
    Last edited by twomers; 01-13-2006 at 06:44 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 06-27-2008, 03:39 PM
  2. help with basic program
    By JOlszewski in forum C Programming
    Replies: 3
    Last Post: 02-01-2006, 04:19 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. Code: An auto expanding array (or how to use gets() safely).
    By anonytmouse in forum Windows Programming
    Replies: 0
    Last Post: 08-10-2004, 12:13 AM