coco1728 2007-12-5 12:03
怎么做一个定时关机的程序呀 急呀~~~~~~~~~~~~!
Option Explicit
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Dim a As Integer
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Command1_Click() '确定开始记时
Select Case a
Case 3
If Left(Text1.Text, 5) - Text2.Text & ":" & Text3.Text = 0 Then
Call ExitWindowsEx(EWX_SHUTDOWN, 0)
End If
Case 2
If Left(Text1.Text, 5) - Text2.Text & ":" & Text3.Text = 0 Then
Call ExitWindowsEx(EWX_REBOOT, 0)
End If
Case 1
If Left(Text1.Text, 5) - Text2.Text & ":" & Text3.Text = 0 Then
Call ExitWindowsEx(EWX_LOGOFF, 0)
End If
End Select
End Sub
Private Sub Command2_Click() '这是结束,就是不要定时了
End
End Sub
Private Sub Form_Load() '显示当时时间
Text1.Text = Time
End Sub
Private Sub Option1_Click(Index As Integer) '用来选择是关机,重起还是注销
a = Index
End Sub
Private Sub Timer1_Timer() '刷新时间
Text1.Text = Time
End Sub
怎么就是不对呀 为什么呀 ????
Nothing 2007-12-5 12:09
XP系统中ExitWindowsEx不好用,需要先得到系统权限
参见 [url]http://www.lihuasoft.net/article/show.php?id=1[/url]
coco1728 2007-12-5 12:25
有点点看不懂 我刚刚接触PAI不太会用,我用的就是XP呀 我怎么才能得到系统权限呀
还有个问题我想问一下:我不知道要怎么才能学好API
也找不到系统的学这个的书
我看了好多的例子了
就是有点不太明白
Nothing 2007-12-5 20:39
API是Windows底层的接口,先找本API入门的书,然后多看看MSDN的平台SDK就可以了。