LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

为什么我调用的WIN API不能实现关机功能?

按win API参考资料,ExitwindowsEx可以实现关机,但我执行VI,只能实现注销系统的功能,为什么呢?
资料上说,uflag=0注销,uflag=1关机,uflag=2重启,uflag=4关闭电源,但我执行时当uflag=0,4时功能都是一样的,只注销系统,而当uflag=1,2时没有任何反应。
那位高手可以指教?
谢谢!
0 Kudos
Message 1 of 3
(5,282 Views)
smercurio_fc wrote:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shutdown/base/system_shutdown_funct...
Specifically read to alinea about AdjustTokenPrivileges on MSDN ExitWindowsEx.

This kind of stuff gets ugly very fast to be implemented with Call Library Nodes only and I would advise writing a DLL instead.
That said I believe there is such a solution already here on the Developer Exchange, so searching a little might be a good idea.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 3 of 3
(5,242 Views)