Results 1 to 3 of 3

Thread: Signal when computer locks

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2014
    Location
    USA
    Posts
    85
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Signal when computer locks

    I'm working in a Windows environment. I have a program that needs to perform a function when the computer locks, whether it's by command + L or time-out. How can I get this? In a windows forum, they gave me the suggestion to use WM_WTSSESSION_CHANGE and then wParam WTS_SESSION_LOCK in the nativeEvent. The only thing is, you have to run WTSRegisterSessionNotification first. I can't run WTSRegisterSessionNotification, because it doesn't seem to exist when I try to call it in the constructor. Is there a way to do this using Qt or does anybody know how to get nativeEvent to see it?
    Last edited by TonyInSoMD; 6th February 2018 at 16:17. Reason: updated contents

Similar Threads

  1. QFileSystemWatcher locks directory
    By NehaGupta in forum Qt Programming
    Replies: 0
    Last Post: 3rd September 2014, 13:42
  2. QReadWriteLock locks for reading...but why?
    By Qtonimo in forum Qt Programming
    Replies: 5
    Last Post: 29th August 2012, 11:58
  3. QwtPlotZoomer locks up, possibly bug?
    By Neekeetos in forum Qwt
    Replies: 12
    Last Post: 10th February 2012, 12:49
  4. Replies: 2
    Last Post: 28th December 2010, 06:20
  5. QThread locks my gui ??
    By LordQt in forum Qt Programming
    Replies: 8
    Last Post: 8th December 2008, 19:53

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.