I want hide cursor after 5 sec. and when clicked right button or mouse moving to show the cursor again.
But cursor didn't hide.


......
.const
......
.data
......
[COLOR=red]
TimerID dd 0
ShowMouse dd TRUE
[/COLOR]
......
.data?
......
.code
start:
......
WndProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
.....
.if uMsg==WM_CREATE
[COLOR=RED]
invoke SetTimer,hWnd,1,5000,NULL
mov TimerID,eax
[/COLOR]
.elseif uMsg==WM_TIMER
[COLOR=RED]
.if ShowMouse==TRUE
invoke ShowCursor,FALSE
mov ShowMouse,FALSE
.endif
[/COLOR]
.elseif uMsg==WM_RBUTTONDOWN
[COLOR=RED]
invoke ShowCursor,TRUE
mov ShowMouse,TRUE
[/COLOR]
......
.elseif uMsg==WM_MOUSEMOVE
[COLOR=RED]
invoke ShowCursor,TRUE
mov ShowMouse,TRUE
[/COLOR]
.elseif uMsg==WM_COMMAND
......
.elseif uMsg==WM_PAINT
......
.elseif uMsg==WM_DESTROY
......
.if TimerID
invoke KillTimer,hWnd,TimerID
.endif
invoke PostQuitMessage,NULL
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
WndProc endp
end start
Posted on 2002-08-27 16:18:09 by Iceberg
WM_CREATE:

invoke SetTimer, [hWnd], 1, 5000, 0
WM_TIMER:
invoke KillTimer, [hWnd], 1
invoke ShowCursor, 0
WM_RBUTTONDOWN or WM_MOUSEMOVE:
invoke ShowCursor, 1
invoke SetTimer, [hWnd], 1, 5000, 0
Posted on 2002-08-27 22:17:58 by comrade