不卡主界面,不占cpu. 下载源码:
test_delay.zip
Delay proc @para ;传毫秒参数
LOCAL @hTimer, @int64:LARGE_INTEGER
mov eax,-10
imul eax,1000
imul eax,@para
lea ebx,@int64
mov dword ptr [ebx],eax
mov dword ptr [ebx+4],-1
invoke CreateWaitableTimer,0,0,0
mov @hTimer,eax
invoke SetWaitableTimer,@hTimer,addr @int64,0,NULL,NULL,0
@@: invoke MsgWaitForMultipleObjects,1,addr @hTimer,0,-1,QS_ALLINPUT
.if eax!=WAIT_OBJECT_0
invoke DoEvent
jmp @b
.endif
invoke CloseHandle,@hTimer
ret
Delay endp
DoEvent proc
LOCAL @msg:MSG
@@: invoke PeekMessage,addr @msg,0,0,0,PM_REMOVE
.if eax!=0
invoke DispatchMessage,addr @msg
invoke TranslateMessage,addr @msg
jmp @b
.endif
ret
DoEvent endp
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)