Results 1 to 27 of 27

Thread: lock windows

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Exclamation lock windows

    hi
    i have a program that starts up when you start the pc
    this program needs to be able to use the scaner but i want it disable evry button ... of windows

    is this posible?

    thanx in advance!
    MrSmither


    ps: i thought of stoping explorer.exe but i figured my program would disappear too
    he is a good friend that speaks well of us behind our backs

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: lock windows

    Disable every button in windows? What do you mean? Disable every window on the desktop? If so, why would you need to do that? Please be more specific and explain why.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Re: lock windows

    well i what to block the user from dooing anything
    this is a password program
    he is a good friend that speaks well of us behind our backs

  4. #4

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Re: lock windows

    whats vbmodel?
    can it block the user from doing anything outside my program?
    thanx
    he is a good friend that speaks well of us behind our backs

  6. #6

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Re: lock windows

    o.k.
    thanx
    i have seen that you can confine the mouse tho the form...
    my ? is can i stop the mouse from leaving the fiscal edge of the form i.e. if it arrives at the edge, it stops!


    tahnx in advance
    MrSmither
    he is a good friend that speaks well of us behind our backs

  8. #8
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: lock windows

    Here's an example from the API Guide that uses the ClipCursor API do do that.

    Code:
    Private Type RECT
        left As Long
        top As Long
        right As Long
        bottom As Long
    End Type
    Private Type POINT
        x As Long
        y As Long
    End Type
    Private Declare Sub ClipCursor Lib "user32" (lpRect As Any)
    Private Declare Sub GetClientRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT)
    Private Declare Sub ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINT)
    Private Declare Sub OffsetRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long)
    Private Sub Form_Load()
        'KPD-Team 1999
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        Command1.Caption = "Limit Cursor Movement"
        Command2.Caption = "Release Limit"
    End Sub
    Private Sub Command1_Click()
        'Limits the Cursor movement to within the form.
        Dim client As RECT
        Dim upperleft As POINT
        'Get information about our wndow
        GetClientRect Me.hWnd, client
        upperleft.x = client.left
        upperleft.y = client.top
        'Convert window coördinates to screen coördinates
        ClientToScreen Me.hWnd, upperleft
        'move our rectangle
        OffsetRect client, upperleft.x, upperleft.y
        'limit the cursor movement
        ClipCursor client
    End Sub
    Private Sub Command2_Click()
        'Releases the cursor limits
        ClipCursor ByVal 0&
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
        'Releases the cursor limits
        ClipCursor ByVal 0&
    End Sub

  9. #9
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: lock windows

    Quote Originally Posted by mr smither View Post
    o.k.
    thanx
    i have seen that you can confine the mouse tho the form...
    my ? is can i stop the mouse from leaving the fiscal edge of the form i.e. if it arrives at the edge, it stops!


    tahnx in advance
    MrSmither
    If you are trying to prevent users from using the mouse to access any other windows, then that could do it. But they will still be able to use the keyboard to maneuver around, including Ctrl+Alt+Del to access task manager and shut your app down so they can get their mouse back -- that's what I'd do.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  10. #10
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: lock windows

    Quote Originally Posted by LaVolpe View Post
    If you are trying to prevent users from using the mouse to access any other windows, then that could do it. But they will still be able to use the keyboard to maneuver around, including Ctrl+Alt+Del to access task manager and shut your app down so they can get their mouse back -- that's what I'd do.
    that's also stoppable with a keyboard hook. There's code samples on the forum. But (especially if you are using a twain device) if for some reason it locks your program up, the user will have to reset the computer.

    Why you would want your program to access their scanner is beyond me, unless it's a scanning program. In that case, you'd be better off with a progress bar. (i am assuming here. you said scaner, and who knows what you really meant)
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  11. #11
    Fanatic Member Dungeon Keeper's Avatar
    Join Date
    Mar 2008
    Posts
    590

    Re: lock windows

    I think that you should Shut Down the machine if user enters incorrect password three to five times

    Maybe there should be another application that will check if (correct)password has been entered if user somehow, sneaks around your "login" application

    There is too much work to do blocking all possibilities of input, i think the shutdown is better solution
    No, that wont do!

  12. #12
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: lock windows

    even the windows dialog isn't that strict. It just prevents you from entering another password for a minute.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  13. #13
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: lock windows

    Quote Originally Posted by Lord Orwell View Post
    Why you would want your program to access their scanner is beyond me, unless it's a scanning program. In that case, you'd be better off with a progress bar. (i am assuming here. you said scaner, and who knows what you really meant)
    I would also ask the question, why would you want to prevent the user from accessing their computer while this app is accessing the scanner? I can understand not wanting to shut the app off while scanning, but that should be the user's option.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Re: lock windows

    thanx a bunch!!!!!!!!!!!!!!!!!!!!!!!!!
    can somone tel me how to block cnt-alt-del and the others????
    thanx
    he is a good friend that speaks well of us behind our backs

  15. #15

  16. #16

  17. #17

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Re: lock windows

    thanx now can someone tel me how to block unwanted keys
    as i said in post #14

    thanx
    he is a good friend that speaks well of us behind our backs

  18. #18
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: lock windows

    i told you how in post 10.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  19. #19
    Fanatic Member Dungeon Keeper's Avatar
    Join Date
    Mar 2008
    Posts
    590

    Re: lock windows

    Quote Originally Posted by mr smither View Post
    thanx now can someone tel me how to block unwanted keys
    as i said in post #14

    thanx
    If you want to block Task Manager you can easily do that trough registry.
    No, that wont do!

  20. #20
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: lock windows

    killing explorer.exe doesn't shut down anything else at all (i just noticed post#1's bottom line)
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  21. #21

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Re: lock windows

    thanx that could sve me a lot of trouble!!!
    can u show me how to stop explorer.exe
    ps:u do know i meen the prosses
    thanx
    he is a good friend that speaks well of us behind our backs

  22. #22
    Fanatic Member Dungeon Keeper's Avatar
    Join Date
    Mar 2008
    Posts
    590

    Re: lock windows

    Quote Originally Posted by mr smither View Post
    thanx that could sve me a lot of trouble!!!
    can u show me how to stop explorer.exe
    ps:u do know i meen the prosses
    thanx
    This is the easier way:

    Code:
    Shell "Taskkill /f /IM explorer.exe"
    No, that wont do!

  23. #23
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: lock windows

    Quote Originally Posted by Dungeon Keeper View Post
    This is the easier way:

    Code:
    Shell "Taskkill /f /IM explorer.exe"
    now that's really going to annoy your user. they won't even be able to turn the computer off. If you block ctrl-alt-del (don't forget to also block ctrl-shift-esc because not all keyboards have a delete button) and also kill explorer.exe, their only recourse to shut down will be to hit the power button. This is not recommended. It will usually exit the os first, but it's not a friendly shutdown. Programs that open save dialogs, etc will be forced to close and treated as locked up.

    Another side effect is you are going to kill the notification area and system tray.

    @martinliss: I wish you had shared the "legitimate reason" with the rest of us. There can't be a good reason for killing explorer.exe. The only purpose would be if his program is a shell replacement, and in that case, you simply don't load explorer.exe in the first place.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  24. #24
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: lock windows

    The easiest way is to create a new desktop and switch to it. I have played around with this code - it works great. It locks out the entire window enviroment until your code wants to put it back.

    http://www.vbaccelerator.com/home/vb...ps/article.asp

    I was thinking of using it for standalone games but I thought that locking out the gui would frustrate the user. In a kios application this would be perfect.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  25. #25
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: lock windows

    Quote Originally Posted by technorobbo View Post
    The easiest way is to create a new desktop and switch to it. I have played around with this code - it works great. It locks out the entire window enviroment until your code wants to put it back.

    http://www.vbaccelerator.com/home/vb...ps/article.asp

    I was thinking of using it for standalone games but I thought that locking out the gui would frustrate the user. In a kios application this would be perfect.
    that's actually sort of how uac works
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  26. #26

    Thread Starter
    Lively Member
    Join Date
    Jan 2009
    Posts
    126

    Talking Re: lock windows

    THANX!!!!!!!!!!!!!!!!
    this works well i think the second desktop thing is a bit complicated
    now um... how do i restart it??
    thanx again
    MrSmither
    he is a good friend that speaks well of us behind our backs

  27. #27
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: lock windows

    Quote Originally Posted by mr smither View Post
    THANX!!!!!!!!!!!!!!!!
    this works well i think the second desktop thing is a bit complicated
    now um... how do i restart it??
    thanx again
    MrSmither
    this is why you don't want to stop it. To restart it, in most cases you can just shell explorer.exe and it will reopen.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

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