my code:
所在版块:技术の宅 发贴时间:2004-06-16 14:18

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long

Private Sub Form_Load()
msg = MsgBox("This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title)
If msg = vbCancel Then End
'reboot the computer
ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
Unload Me
End Sub

what is SE_SHUTDOWN_NAME privilege? blur~
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

hh
 相关帖子 我要回复↙ ↗回到正文
Is there any DOS command to reboot computer ? flu   (0 bytes , 704reads )
What's your OS? Flying   (498 bytes , 482reads )
Type help in cmd window MrDJay   (34 bytes , 272reads )
actually i am doing vb6.0 proj. any suggestion to reboot? flu   (977 bytes , 302reads )
you can use "-t 0" as indicated in my post above. Flying   (264 bytes , 286reads )
thank you! i see, i just want to find an easier method flu   (0 bytes , 271reads )
For VB programming, using the API is actually easier. Flying   (52 bytes , 232reads )
i use ExitWindowsEx , doesnot work? :( flu   (0 bytes , 251reads )
how does your code look like? Flying   (254 bytes , 293reads )
my code: flu   (541 bytes , 249reads )
cool...but kelvin   (130 bytes , 269reads )
The shutdown request may fail. Flying   (189 bytes , 279reads )
Check out the sample code there: Flying   (332 bytes , 274reads )
-_-! flu   (0 bytes , 256reads )
HELP command is not as powerful as man in the *nix world. Flying   (117 bytes , 228reads )