Author Topic: Lock/Log off PC  (Read 696 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • GitHub
Lock/Log off PC
« on: June 22, 2020, 03:39:08 pm »
Thought someone might find it slightly useful. This code simply either locks the PC or logs it off. The flags can be used to even cause a shutdown but the way it is here just causes a logoff. Check out the MSDN pages to see all the flags. Could be good for a task scheduler program written in QB64.
Code: QB64: [Select]
  1.     FUNCTION LockWorkStation ()
  2.     FUNCTION ExitWindowsEx (BYVAL flags, BYVAL reason)
  3.  
  4. 'a = ExitWindowsEx(0, 0) 'logoff
  5. a = LockWorkStation 'lock pc
Shuwatch!