Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How can i lock keyboard and mouse on Windows 9X and Windows NT/2000/XP

How can i lock keyboard and mouse on Windows 9X and Windows NT/2000/XP

Scheduled Pinned Locked Moved C / C++ / MFC
questionsysadmin
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I'm writting a client program that lock the keyboard, mouse until the server unlock it. How can I do that on Windows 9X, and Windows NT/2000/XP? How can I prevent CTRL+ALT+DEL, ALT+TAB... and hide my client from task list? Thanks for any idea.

    J J V 3 Replies Last reply
    0
    • L Lost User

      I'm writting a client program that lock the keyboard, mouse until the server unlock it. How can I do that on Windows 9X, and Windows NT/2000/XP? How can I prevent CTRL+ALT+DEL, ALT+TAB... and hide my client from task list? Thanks for any idea.

      J Offline
      J Offline
      JoeSox
      wrote on last edited by
      #2

      wow, that would make a nice virus;) Later,
      JoeSox
      www.joeswammi.com
      It's not easy facin' up when your whole world is black
      Rolling Stones

      L 1 Reply Last reply
      0
      • J JoeSox

        wow, that would make a nice virus;) Later,
        JoeSox
        www.joeswammi.com
        It's not easy facin' up when your whole world is black
        Rolling Stones

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        No, it's not a virus. It is a client program of an Internet Cafe Manager software. :) Have you have any idea?

        J 1 Reply Last reply
        0
        • L Lost User

          No, it's not a virus. It is a client program of an Internet Cafe Manager software. :) Have you have any idea?

          J Offline
          J Offline
          JoeSox
          wrote on last edited by
          #4

          bpmtri wrote: No, it's not a virus. It is a client program of an Internet Cafe Manager software. I guess I am not understanding why you would want to lock the keyboard, don't these users need the keyboard:confused: bpmtri wrote: Have you have any idea? I'll help you brainstorm. What OS will the users be using? This will help point in the right direction. Later,
          JoeSox
          www.joeswammi.com
          It's not easy facin' up when your whole world is black
          Rolling Stones

          L 1 Reply Last reply
          0
          • J JoeSox

            bpmtri wrote: No, it's not a virus. It is a client program of an Internet Cafe Manager software. I guess I am not understanding why you would want to lock the keyboard, don't these users need the keyboard:confused: bpmtri wrote: Have you have any idea? I'll help you brainstorm. What OS will the users be using? This will help point in the right direction. Later,
            JoeSox
            www.joeswammi.com
            It's not easy facin' up when your whole world is black
            Rolling Stones

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            I'm sorry. I have not described my problem clearly. I need to lock the keyboard (include special keys: CTRL+ALT+DEL, ALT+TAB...) and mouse to prevent the user from using the workstation without entering a valid ticket number. On Windows 2000/XP, How can I prevent user pressing CTRL+ALT+DEL. And again, how can I hide my client from Task List on Windows 9X? Thanks in advance.

            1 Reply Last reply
            0
            • L Lost User

              I'm writting a client program that lock the keyboard, mouse until the server unlock it. How can I do that on Windows 9X, and Windows NT/2000/XP? How can I prevent CTRL+ALT+DEL, ALT+TAB... and hide my client from task list? Thanks for any idea.

              J Offline
              J Offline
              Joan M
              wrote on last edited by
              #6

              WIN NT BASED OSes ONLY: ----------------------- KEYBOARD AND MOUSE 1: Take a look at "systemwide hooks" in MSDN in order to know how to prevent some system keystrokes and the mouse movements... NOTES: a system wide hook must be placed in a DLL in order to be systemwide and not application related. (its easier than what it seems). I use to create two services (take a look at the VC++ assistant and create an ATL service) in order to use those DLL's (remember to keep some way to disbale those services using a password or something else...) KEYBOARD AND MOUSE 2 (CTRL ALT DEL): In order to capture those keystrokes, in NT you MUST write down a GINA DLL, this DLL is a security DLL that controls those kind of things, it's for security purposes, you cannot expect that an OS would be secure and to allow any programmer to execute any code that would be able to get the users passwords. (that DLL must be installed in the system and must be placed in it's own registry key). PS: Under win9x I remember I had readen something in the MSJ from PAul DiLascia that talked about preventing Ctrl Alt Del using a registry key... try to search for it... Hope this helps

              https://www.robotecnik.com freelance robots, PLC and CNC programmer.

              A 1 Reply Last reply
              0
              • L Lost User

                I'm writting a client program that lock the keyboard, mouse until the server unlock it. How can I do that on Windows 9X, and Windows NT/2000/XP? How can I prevent CTRL+ALT+DEL, ALT+TAB... and hide my client from task list? Thanks for any idea.

                V Offline
                V Offline
                Valera241176
                wrote on last edited by
                #7

                Using Windows API functions g_hMsgHook = SetWindowsHookEx(WH_GETMESSAGE, (HOOKPROC)Msg_HookProc, hInst, 0); and g_hKeyHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)Key_HookProc, hInst, 0); you can hook (block) any keys in win9x/NT except ctrl+alt+del. In win 9x ctrl+alt+del can be locked by SystemParametersInfo(SPI_SCREENSAVERRUNNING, TRUE, &g_bKillAllSysKeys, 0); In NT ctrl+alt+del can be blocked by writing your own Gina.dll (exported function WlxLoggedOnSAS), but be carefull with Gina... For more details, see description of these functions in MSDN

                1 Reply Last reply
                0
                • J Joan M

                  WIN NT BASED OSes ONLY: ----------------------- KEYBOARD AND MOUSE 1: Take a look at "systemwide hooks" in MSDN in order to know how to prevent some system keystrokes and the mouse movements... NOTES: a system wide hook must be placed in a DLL in order to be systemwide and not application related. (its easier than what it seems). I use to create two services (take a look at the VC++ assistant and create an ATL service) in order to use those DLL's (remember to keep some way to disbale those services using a password or something else...) KEYBOARD AND MOUSE 2 (CTRL ALT DEL): In order to capture those keystrokes, in NT you MUST write down a GINA DLL, this DLL is a security DLL that controls those kind of things, it's for security purposes, you cannot expect that an OS would be secure and to allow any programmer to execute any code that would be able to get the users passwords. (that DLL must be installed in the system and must be placed in it's own registry key). PS: Under win9x I remember I had readen something in the MSJ from PAul DiLascia that talked about preventing Ctrl Alt Del using a registry key... try to search for it... Hope this helps

                  A Offline
                  A Offline
                  Alexinuk
                  wrote on last edited by
                  #8

                  Joan Murt wrote: KEYBOARD AND MOUSE 2 (CTRL ALT DEL): In order to capture those keystrokes, in NT you MUST write down a GINA DLL, this DLL is a security DLL that controls those kind of things, it's for security purposes, you cannot expect that an OS would be secure and to allow any programmer to execute any code that would be able to get the users passwords. (that DLL must be installed in the system and must be placed in it's own registry key). That's what I thought, until I saw this: http://msdn.microsoft.com/msdnmag/issues/02/09/cqa/default.aspx Seems it's not all that tricky unless you don't like a message box saying "Don't do this"

                  J 1 Reply Last reply
                  0
                  • A Alexinuk

                    Joan Murt wrote: KEYBOARD AND MOUSE 2 (CTRL ALT DEL): In order to capture those keystrokes, in NT you MUST write down a GINA DLL, this DLL is a security DLL that controls those kind of things, it's for security purposes, you cannot expect that an OS would be secure and to allow any programmer to execute any code that would be able to get the users passwords. (that DLL must be installed in the system and must be placed in it's own registry key). That's what I thought, until I saw this: http://msdn.microsoft.com/msdnmag/issues/02/09/cqa/default.aspx Seems it's not all that tricky unless you don't like a message box saying "Don't do this"

                    J Offline
                    J Offline
                    Joan M
                    wrote on last edited by
                    #9

                    That's not a great idea (I think...) 1. Policies can be modified by software, then, any program will be able to modify the policies and it can be dangerous for the user who would be working at admin level. 2. Of course that this will be easier than making a new GINA, and depending on the scenery it can be very interesting. Thank you, always is great to learn new things.

                    https://www.robotecnik.com freelance robots, PLC and CNC programmer.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups