vb中timeSetEvent函数怎么用的?

2022-03-26 社会 80阅读
OptionExplicit
PrivateDeclareFunctiontimeKillEventLib"winmm.dll"(ByValuIDAsLong)AsLong
PrivateDeclareFunctiontimeSetEventLib"winmm.dll"(ByValuDelayAsLong,ByValuResolutionAsLong,ByVallpFunctionAsLong,ByValdwUserAsLong,ByValuFlagsAsLong)AsLong
DimpAsLong
PrivateConstTIME_周期AsLong=1
PrivateConstTIME_一次性AsLong=0
PrivateSubForm_DblClick()
timeKillEventp
p=0
EndSub
PrivateSubForm_Load()
p=timeSetEvent(300000,10,AddressOfTimeProc,1,TIME_一次性)
Debug.PrinttimeGetTime
EndSub
PrivateSubForm_QueryUnload(CancelAsInteger,UnloadModeAsInteger)
IfpThentimeKillEventp:p=0:Cancel=True:Timer1.Enabled=True
EndSub
PrivateSubTimer1_Timer()
Timer1.Enabled=False
UnloadMe
EndSub
[/font]

模块代码:
OptionExplicit
PublicDeclareFunctiontimeGetTimeLib"winmm.dll"()AsLong
SubTimeProc(ByValuIDAsLong,ByValuMsgAsLong,ByValdwUserAsLong,ByValdw1AsLong,ByValdw2AsLong)
Debug.PrinttimeGetTime
EndSub
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com