Results 1 to 3 of 3

Thread: Entering a Password in an Internet Explorer Window

  1. #1
    Join Date
    Jan 2008
    Posts
    31
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Entering a Password in an Internet Explorer Window

    I have a program that launches an Internet Explorer page as a QProcess and I need to pass two lines of login information plus a password.

    I use QProcess process.setWorkingDirectory( "string",args);
    process.start( "string");
    etc.



    I get the handle of the IE window and use the following subroutine to input to IE:

    void TWOlogon::sendString( QByteArray string)
    {
    EnableWindow( hTWO, true);

    int length = string.count()+1;
    for( int i=0; i<length; i++)
    {
    keybd_event( string[i], 0,0,0);
    keybd_event( string[i], 0, KEYEVENTF_KEYUP, 0);
    }
    }

    This subroutine successfully passes the user login information, but when I try to input the password very strange behaviour takes place. Only two characters show on the password input screen and depending upon the password characters odd things happen to the IE screen such as expanding it to full screen, removing the favorites list, etc.

    Any suggestions on what I'm doing wrong?

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Entering a Password in an Internet Explorer Window

    I don't know, but you seem to be inputting as the last character string[string.count()], which might mess things up. (Why is length = string.count()+1);

  3. #3
    Join Date
    Jan 2008
    Posts
    31
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Entering a Password in an Internet Explorer Window

    It's necessary to add 1 to length to account for the endl character. Without adding the 1, nothing prints on the line.

    I've partially solved the problem of inputing the password. The above code successfully inputs user data such as ID and User Name, but fails while trying to input the password. I changed the code so the input looks like this for the password:

    keybd_event( 0x31, 0,0,0);
    keybd_event( 0x31, 0, KEYEVENTF_KEYUP, 0);
    etc.

    where 0x31 is the byte equivalent of the 1 character.

    Not sure why the password input requires this, but it works. Now the problem is how to pack the series of 0x** characters into a QByteArray so I can pass this to the sendString subroutine.

Similar Threads

  1. how to create internet explorer toolbar using Qt?
    By live_07 in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2011, 07:28
  2. Popup window explorer
    By dorians58 in forum Newbie
    Replies: 3
    Last Post: 23rd July 2010, 05:26
  3. how to display a qt widget into internet explorer
    By azaelge in forum Qt Programming
    Replies: 6
    Last Post: 28th July 2009, 15:36
  4. Entering variable in db
    By subratatamal in forum Qt Programming
    Replies: 1
    Last Post: 13th December 2008, 17:50
  5. QFtp: entering deep folder (cd)
    By Raccoon29 in forum Newbie
    Replies: 1
    Last Post: 13th May 2008, 09:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.