CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2003
    Posts
    9

    Windows Event Listener

    I am writing a program to auto fill in Windows Prompt. This program will run when start up Windows.

    If Windows prompt for user id and password Then
    Read c:\user.txt
    If empty Then
    Do nothing
    Else
    Read in the id & password
    Fill in the id and password to the Windows Prompt
    Submit
    End If
    Else
    do nothing
    End If

    Could you advice me how to get started ?

    Updated at 7:26PM Singapore Time :-
    I find a freeware that is similar to my requirement.
    (Push the Freakin' Button is a freeware, button pressing utility for use with Windows 95/98/ME, NT4 and Windows 2000. )
    http://www.bobos.demon.co.uk/par/PTFB.htm

    I wonder how this ptfb.exe receive the popup event ? (I mail the author a few days ago but not reply yet.)
    Last edited by guojinwen; January 13th, 2003 at 06:26 AM.

  2. #2
    Join Date
    Dec 2002
    Posts
    214
    you are almost figure it out....

    you can find the login window and send messages to it..

    That's it..

  3. #3
    Join Date
    Jan 2003
    Posts
    9

    Question

    How to find the login window and send messages to it ? Which function to call ? Thanks.

  4. #4
    Join Date
    Dec 2002
    Posts
    214
    enumwindows, findwindowEx.. etc.

    i have not put my idea into codes, so i am afraid i cannot provide more details before i have implement such function..

    If you have figure it out, let me share your joys.

  5. #5
    Join Date
    Jan 2003
    Posts
    9
    I want the program to run upon user login till logoff, in this case, I got to write a infinite loop, inside the loop, I check if there is such logon prompt, if have, then process it, else, just keep on looping.

    Is this conceptually correct to implement these type of application ?

  6. #6
    Join Date
    May 2000
    Location
    Washington DC, USA
    Posts
    715
    The algorithm you've designed might work. The problem is when you're polling for a window to appear as you've designed is a poor choice. If you poll too often you're hosing up your system performance. If you poll too infrequently then the user waiting to auto login will be annoyed he has to wait longer than it would have taken him to type in his userid and login.

    A better solution would be to just change the login on the box to default one user and then no fuss no muss you're set.

    If you're dieing for a programming solution, the approach I've seen used in the past is to modify the registry to instantiate auto login. Here is a working example complete with code..

    http://www.bbdsoft.com/downloads/msvc/alogin.zip

    have fun..

  7. #7
    Join Date
    Dec 2002
    Posts
    214
    IF you CAN let windows load your exe befere the logon dialog appears, in Win2k, you can do it. But i think this is another job.

    Sometimes, SendMessage will fail if you have not privileges. Think like that if you can change the password automatically it also means you can get the password easily, the Windows have a BIG BUG and is vulnerable..

    Isn't It? maybe i am wrong..

  8. #8
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882
    SendMessage wont work , because there is Desktop limitation. As logon window is in anather desktop (\WinSta0\WinLogon) that windows default desktop. If you send message the logon window will become visible on winlogon desktop not on interactive default desktop.
    Regards,
    Ramkrishna Pawar

  9. #9
    Join Date
    Jan 2003
    Posts
    9

    Smile

    I find a freeware that is similar to my requirement.
    (Push the Freakin' Button is a freeware, button pressing utility for use with Windows 95/98/ME, NT4 and Windows 2000. )
    http://www.bobos.demon.co.uk/par/PTFB.htm

    I wonder how this ptfb.exe receive the popup event ? (I mail the author a few days ago but not reply yet.)

  10. #10
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882
    If you want something releted to windows auto login then ask for auto login , it can be done by setting few registry keys. The free ware you r showing is diff. functionality thing ,not autologin or releted to windows Logon procedure.
    Regards,
    Ramkrishna Pawar

  11. #11
    Join Date
    Jan 2003
    Posts
    9
    What I want is to auto fill in a Windows Prompt, (user id & password prompt is just an example.), and auto click the OK buttom, not auto login. Sorry for any confusion caused.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured