function Isrunning(byval programID) as boolean
dim hp as long
hp=openprocess(0,false,programID)
if not hp=0 then
isrunning=true
else
isrunning=false
endif
closehandle hp
sub form_click()
dim x
me.capion="begin"
x=shell("notepad.exe",1)
while isrunning(x)
doevents
wend
me.caption="end"
end sub
Public Sub Wait_S(SecondV As Single)
Dim i As Single, j As Single
i = Timer + SecondV
Do While i > Timer
If Timer < 1 And i >= 86400 Then '跨0点处理
i = i - 86400
End If
DoEvents
Loop
End Sub