LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

windows lock desktop and logoff via SDK? Has anyone tried this?

Looked thru SDK, not apparently obvious on how to via SDK command to logoff and lock-the-desktop function. Meaning to actually logoff and lock the desktop like is available when in windows.

Has anyone tried this successfully?
cvier
0 Kudos
Message 1 of 4
(3,321 Views)
The functions you are looking for are ExitWindowsEx and LockWorkstation, respectively.

ex:


ExitWindowsEx (EWX_LOGOFF, SHTDN_REASON_MINOR_OTHER);


The second parameter of this function is the reason for the "shutdown" which may generate system events, logs, etc. depending on what you choose. Check the MSDN for more details.


LockWorkstation();


This one is pretty easy!

Hope this helps,

Alex
0 Kudos
Message 2 of 4
(3,315 Views)
Works well.
Thanks,
cvier
0 Kudos
Message 3 of 4
(3,298 Views)
I think I tried ExitWindowsEx function in Xp but it did not work. ( I tried long time back). So I am using shutdown /r command which exists in XP.
For help just type in shutdown /? in your command prompt.

Sheetal
Thanks.
CVI 2010
LabVIEW 2011 SP1
Vision Builder AI 2011 SP1
0 Kudos
Message 4 of 4
(3,278 Views)