Results 1 to 5 of 5

Thread: Locking form

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    49

    Question Locking form

    Guyz

    I want to lock my form when I go out of the office, so that no one can my application. How can I make my application lock and show another form with a password input. I experiment it by disabling form1.enable = false then show a login form. Is that correct? I need advice from the expert. How can I disable the close button in the login form?

    Another question: Can I remove my form1 or application in the end task??

    Thanks

  2. #2
    Member devil_jin's Avatar
    Join Date
    Feb 2006
    Location
    USA
    Posts
    44

    Re: Locking form

    wow just a few weeks ago i created a lock down screen hoping your using windows xp , i'll give you the link to the full source code make sure you find the password in the code an change it , try mixing this and your application together ot just simply compile and use it, Link is:

    http://www.pscode.com/vb/scripts/Sho...64768&lngWId=1

    Nothing can get past my lock down screen, also if you do not want it to start up when windows loads in the the code delete
    Code:
    REGSaveSetting vHKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run", "LoGonWindow", App.Path & "\" & App.EXEName & ".exe"
    Hope this helps

  3. #3
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

    Re: Locking form

    myrea,

    I am assuming you want to let other users use the computer while you're away just not your app.

    You could hide the main form (form1.Hide) then show it again after sucessful login (form1.Show).

    Instead of putting up the login screen you could use a task tray icon. When the user clicks on the icon he gets the login window.

    This way you won't have to worry about what happens if he closes the login window because you can bring it up again from the task tray icon.

  4. #4

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    49

    Re: Locking form

    Quote Originally Posted by moeur
    myrea,

    I am assuming you want to let other users use the computer while you're away just not your app.

    You could hide the main form (form1.Hide) then show it again after sucessful login (form1.Show).

    Instead of putting up the login screen you could use a task tray icon. When the user clicks on the icon he gets the login window.

    This way you won't have to worry about what happens if he closes the login window because you can bring it up again from the task tray icon.
    Thanks guyz! Thanks devil jin

    Thanks moeur but I want my application visible because I have "clock" there.

    And I want everyone to see the clock and there time in because my

    application is like a in a internet cafe with a time in and time out and I dont

    want them to edit their time. Thanks.

  5. #5
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Locking form

    Make KeyPreview for the form true. Trap all keypresses. If the user presses alt-Q (or whatever key you want for "unlock", turn off the trapping, otherwise return a 0. Maybe pop up a msgbox that tells them that the app is locked. (Turn trapping on with a command or by clicking on something people normally don't click on, like a picture.)

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