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

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -