Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to tell when user locks computer (windows)?
Qt 6.12 LTS is out! See what's new in the release blog

How to tell when user locks computer (windows)?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 3.2k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello I'm wondering how to tell when the user locks the computer (windows xp, vista & 7). My intention is to create a small app that that logs the time the computer is locked and unlocked. So I need to know how to tell when the user locks the computer so it can log the time. Thank you!
    Best regards
    Richard

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      You will have to use platform-specific code. Take a look at "WTSRegisterSessionNotification":http://goo.gl/NyRd6 and "WM_WTSSESSION_CHANGE":http://goo.gl/TebEK.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Lukas can u provide simple example how to use it, pls ?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved