views:

75

answers:

2

I'm trying to do this with no luck so far.

I'm listening for the WM_SETCURSOR messages and setting the cursor there, it works most times, but not always. I've seen two other cases that I need to catch:

  • WM_PAINT: At least after a WM_LBUTTONDOWN the cursor is painted somehow without calling WM_SETCURSOR...
  • WM_CAPTURECHANGED: Happening sometimes when the mouse is down and moving it.

Even doing all this the cursor sometimes flickers and the original one can be seen in some cases (eg: the instant when you roll over some object that sets the cursor to something else). I've been trying to look for some other patterns or messages but didn't see anything that would solve this problem. Has anyone succeeded in doing this?

A: 

Nobody has any clue or tip? I've added some hacks and workarounds to the SWF files themselves, but I'd love to fully solve this problem without resorting to these things.

Neverbirth
A: 

I decided to check for some more messages and change the cursor before and after returning it...

I went with this method in the following messages:

  • WM_PAINT (only after returning and if the mouse is over the flash window)
  • WM_NCHITTEST (only after returning and if the mouse is over the window)
  • WM_CAPTURECHANGED
  • WM_MOUSEACTIVATE
  • WM_LBUTTONDOWN (only after returning)
  • WM_LBUTTONDBLCLICK (only after returning)
  • WM_LBUTTONUP (only after returning)
  • WM_MOUSEHOVER
  • WM_MOUSEMOVE

WM_MOUSEMOVE was needed for when I step over some hotspot that causes a change of cursor... and was trying to avoid catching WM_NCHITTEST... but it's the only solution I found for some extreme case in a movie...

Of course I only change the cursor if it's not already the one I want.

I still see some flickering rarely, but I guess I can deal with it. If someone could validate this as a valid answer, or can provide a better one, I'll finish this thread. Thanks.

Neverbirth
Also, since I made so many tests and wanted to finish this already, WM_MOUSEACTIVATE may not be needed, but added it anyway.WM_LBUTTONDOWN and WM_LBUTTONDBLCLICK are needed for when you click over some interactive object, and WM_LBUTTONUP is needed just in some cases...
Neverbirth