Results 1 to 12 of 12

Thread: Lock of The Desktop

  1. #1
    altobji
    Guest

    Lock of The Desktop

    Dear ALL,
    I'm trying to lock the Desktop from being accessed by the user unless he enter the correct Username and passswod ....

    i managed to lock the desktop from being accessed by mouse ...
    but the problem is that he still can use the sys. keys (as CTRL , ALT + TAB , Windows key....etc) in which i want to disable .. so only he can type letters and numbers ..... any suggestion will make me very greatful...

    Thanx in advance

  2. #2
    j2k
    Guest
    See my post here for info on blocking sys keys for the Windows 9x platform.

    (Code does not work for Windows NT/2000)

    HTH.

  3. #3
    altobji
    Guest

    Thanks..BUT the ALT+F4 is still working .

    Thanks alot for ur concern and time....
    everything is Ok except that the ALT+F4 combination is still working and it as usual cuase the applicaiton to terminate ...in which i don't wan't the user to be able to do...

    any Help...
    Thanks in advace

  4. #4
    Frenzied Member Microbasic's Avatar
    Join Date
    Mar 2001
    Posts
    1,402
    You can do that by putting this code in form_Unload:

    VB Code:
    1. If PasswordC = False Then Cancel = True

    And put this code just before the form UNLOADS because of a correct password:

    VB Code:
    1. PasswordC = True

    Don't forget to put this in the General_Declarations:

    VB Code:
    1. Public PasswordC As Boolean




    MicroBasic
    Dragon Shadow Trainer

    There is no good or evil in the world...only programmers and fools .

  5. #5
    Frenzied Member Microbasic's Avatar
    Join Date
    Mar 2001
    Posts
    1,402
    Or, put this in the FORM_QUERYUNLOAD Section:

    VB Code:
    1. If unloadmode <> 1 Then Cancel = True


    MicroBasic
    Dragon Shadow Trainer

    There is no good or evil in the world...only programmers and fools .

  6. #6
    altobji
    Guest

    But this Way????

    Thanx Microbasic for ur time...
    But this way he Might Press (ALT+F4) and close the App
    witout entering the correct things... and i want to prevent him from doing this

  7. #7
    In the Form_QueryUnload event, add the line Cancel = True after checking to make sure that the event was called from something OTHER than code (see the VB help for QueryUnload).

  8. #8
    Frenzied Member Microbasic's Avatar
    Join Date
    Mar 2001
    Posts
    1,402

    Have you even tried the code?

    They CAN'T. Alt_F4 is just a shortcut for the CLOSE button on the caption bar. BOTH of my codes prevent the form from unloading in any way except for the Unload function, so NO USER CAN USE Alt_F4 for exiting.


    MicroBasic
    Dragon Shadow Trainer

    There is no good or evil in the world...only programmers and fools .

  9. #9
    altobji
    Guest
    thanx alot... yes u where wright ... thanx again....
    ooh ... sorry if i would be rood... do u know about Viedo Streaming an VB .... forgive me....

  10. #10
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    The idea is to hide all the windows and display your app in maximized form.

    Then even if they use ctl+alt+del they still can't get to anything. To disable ctl+alt+del in NT need to subclass it. Alternatively dirty way is to capture keypresses from a timer.

  11. #11
    altobji
    Guest

    need more help

    can u plz be more descriptive about the subclass tech. u just declared about...

  12. #12
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    Well I don't think it is possible from VB, you need C++ to create a standard dll to create a system wide hook.
    Last edited by Nucleus; Aug 19th, 2001 at 04:22 AM.

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