c++ - ShowCursor has no effect until the mouse is moved -
i need hide cursor when left , right buttons both pressed. turns out code working expected except minor glitch mouse move.
when call showcursor(false) cursor becomes hidden expected. after when call showcursor(true) cursor not appearing again until next mouse move. opinion - not drawn until mouse event occurs. there way force cursor redrawn?
code:
void sg::cursormanager::hidecursor(void) { while(showcursor(false) >= 0); } void sg::cursormanager::showcursor(void) { while(showcursor(true) <= 0); }
if understand correctly how cursor work in windows, have call setcursor(idc_...)
make cursor visible immediately.
the thing cursor set window beneath, response message wm_setcursor
. idea of showcursor()
disables/enables wm_setcursor
message. when disabling cursr setcursor(null)
cursor dissapears. when enabling cursor cannot call setcursor(idc_...)
because not know cursor should shown. waits until next wm_setcursor
generated, until mouse moved.
Comments
Post a Comment