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. Screen Lock for MFC App

Screen Lock for MFC App

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelptutorialquestion
4 Posts 3 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.
  • D Offline
    D Offline
    Donguy1976
    wrote on last edited by
    #1

    Hello All, I have a MFC app thats being developed in VS 6.0 If the app is idle for more than 5 mins it should lock automatically. i.e., the next time when user tries to click anywhere on app, it should ask for user name and password. Is there any good examples for that? The closest example i can think of is the screen saver lock in Windows operating system. Any sample code will help. Thanks in advance.

    A L 2 Replies Last reply
    0
    • D Donguy1976

      Hello All, I have a MFC app thats being developed in VS 6.0 If the app is idle for more than 5 mins it should lock automatically. i.e., the next time when user tries to click anywhere on app, it should ask for user name and password. Is there any good examples for that? The closest example i can think of is the screen saver lock in Windows operating system. Any sample code will help. Thanks in advance.

      A Offline
      A Offline
      Andre Kraak
      wrote on last edited by
      #2

      Have a look at this article HOWTO track a user's idle time[^]; it seems to have a good implementation on how to detect the idle time. When the idle time (five minutes) has been reached you could show a modal dialog that requires the user to specify his/her user name and password.

      0100000101101110011001000111001011101001

      L 1 Reply Last reply
      0
      • A Andre Kraak

        Have a look at this article HOWTO track a user's idle time[^]; it seems to have a good implementation on how to detect the idle time. When the idle time (five minutes) has been reached you could show a modal dialog that requires the user to specify his/her user name and password.

        0100000101101110011001000111001011101001

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

        Wow, That is a really old article... and the code is essentially implementing a system-wide window hook. That code would actually fail on Vista+ operating system unless modified to use attachthreadinput and executed from an administrative account. :) Best Wishes, -David Delaune

        1 Reply Last reply
        0
        • D Donguy1976

          Hello All, I have a MFC app thats being developed in VS 6.0 If the app is idle for more than 5 mins it should lock automatically. i.e., the next time when user tries to click anywhere on app, it should ask for user name and password. Is there any good examples for that? The closest example i can think of is the screen saver lock in Windows operating system. Any sample code will help. Thanks in advance.

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

          Hi, I recommend that you have a look at the GetLastInputInfo function[^]. Best Wishes, -David Delaune

          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