Question

I have an application running under Direct3D9. The application is using the Direct3D HW cursor API (IDirect3DDevice9::SetCursorProperties et al.) to control the cursor. Almost everything works fine:

  • when inside of the application window, the cursor specified by SetCursorProperties is shown
  • when outside of the application window, normal OS cursor is displayed as needed by desktop or other windows

The problem is with the non-client area of my window (the title bar, screen edges). When moving in the non-client area, the cursor corresponding to the function of the area is breifly shown, but once I stop moving, the cursor set in SetCursorProperties is shown again.

What is the correct way to use IDirect3DDevice9::SetCursorProperties so that I get the default OS cursors on my window non-client area?

Was it helpful?

Solution

After experimenting with various things, a following change in the application has solved the issue for me:

  • In a window procedure, when a WM_SETCURSOR is received, remember a result of a condition (lParam&0xffff)==HTCLIENT in a global variable CursorInClient
  • When the global variable CursorInClient is false, avoid calling IDirect3DDevice9::ShowCursor
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top