Results 1 to 2 of 2

Thread: Locking and Unlocking Windows/Unix desktop

  1. #1
    Join Date
    Oct 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Locking and Unlocking Windows/Unix desktop

    Hello All.

    As part of my project I would like my desktop application to be able to Lock and UnLock a PC.

    Does anyone know if this is possible in Qt or C++?, I have been looking around and can't see it noted in the documentation or any forums for that matter.

    What I mean:
    If I clicked a button on my app it would be the same as hitting "Windows + L" (locking pc on windows)
    Also remotely tell the program to UnLock the pc too.

    I can figure that the code is going to have to be System Dependant, but if I could get it working primarily with Windows (XP/Vista/7) that would great.

    Any help or direction would be greatly appreciated.

    Thanks in advance.

    Chris

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Locking and Unlocking Windows/Unix desktop

    You can emulate Windows+L in software by using LockWorkStation() (Win32API call) but the software must be running on the interactive desktop. Software running in the background will be refused by GINA (Graphical Identification and Authentication).

    There is no function for unlocking, as that would cause a security concern.

    If you wish to do both locking and unlocking in your own software, you will have to write your own - eg. write a keyboard hook, kill the explorer.exe process, etc, but ctrl-alt-del would still work to bring up task manager and you can't filter out that key sequence.

Similar Threads

  1. Associate Program Icon for Windows Desktop
    By brent99 in forum Newbie
    Replies: 2
    Last Post: 11th March 2008, 04:22
  2. Emulating Unix on Windows
    By eichner in forum Qt Programming
    Replies: 5
    Last Post: 14th February 2008, 18:13
  3. distinguish windows and unix in Makefile
    By magland in forum General Programming
    Replies: 1
    Last Post: 4th April 2007, 19:43
  4. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 01:00

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.