Mirror Driver - Filter out DrvCopyBits/DrvBitBlt for mouse movement

Hi,

I’m writing a mirror driver, and all works fine until now, with one exception: the system is simulating the mouse pointer, and it calls DrvCopyBits and/or DrvBitBlt every time the mouse moves.
I want to filter out these calls: that is, either not to receive them at all for mouse movements, either to receive and identify what calls are for mouse movements so I can ignore them.

I implemented DrvMovePointer() and DrvSetPointerShape(), but they are not called when I need it:

  • They are not called at the beginning.
  • They are not called when the cursor changes over a window corner or border (the cursor changes to show you can resize the window).
  • They are not called when the cursor is normal arrow.

I found only two cases when these functions are called:

  1. When the pointer changes over an EDIT control, such as address bar of Explorer, they are called as expected until I move the mouse outside the EDIT control.
  2. When I set the flag GCAPS_ASYNCMOVE in DEVINFO structure (in DrvEnablePDEV), only DrvMovePointer() is called (as expected).

In this last case I tried to use this call to filter out DrvCopyBits/DrvBitBlt, but I do not know a way to identify which DrvCopyBits/DrvBitBlt is related to this DrvMousePointer call.

Does anyone have any idea how to filter out DrvCopyBits/DrvBitBlt for mouse movement?

Thanks a lot,
Paul

xxxxx@yahoo.com wrote:

I’m writing a mirror driver, and all works fine until now, with one exception: the system is simulating the mouse pointer, and it calls DrvCopyBits and/or DrvBitBlt every time the mouse moves.
I want to filter out these calls: that is, either not to receive them at all for mouse movements, either to receive and identify what calls are for mouse movements so I can ignore them.

I found only two cases when these functions are called:

  1. When the pointer changes over an EDIT control, such as address bar of Explorer, they are called as expected until I move the mouse outside the EDIT control.
  2. When I set the flag GCAPS_ASYNCMOVE in DEVINFO structure (in DrvEnablePDEV), only DrvMovePointer() is called (as expected).

In this last case I tried to use this call to filter out DrvCopyBits/DrvBitBlt, but I do not know a way to identify which DrvCopyBits/DrvBitBlt is related to this DrvMousePointer call.

Does anyone have any idea how to filter out DrvCopyBits/DrvBitBlt for mouse movement?

I don’t believe there is any completely reliable method. You are at the
mercy of the primary display driver here. If the primary display driver
doesn’t handle the type of mouse being displayed, then GDI will fall
back to DrvCopyBits and DrvBitBlt, and since you get everything the
primary gets, you’ll get those, too.

Have you tried tracking the pointer location in DrvMovePointer to watch
for calls near that point?


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

[Have you tried tracking the pointer location in DrvMovePointer to watch
for calls near that point?]

Yes, I did it. I see the calls to DrvBitBlt for rectangles bounding the mouse pointer. The problem is I do not know what are the dimensions for the pointer, neither where the hotspot is, so I could not know for sure which DrvBitBlt is related to mouse movement and which is related to other drawings related to mouse, for example underlining/changing color of a hyperlink, showing up a tooltip window or 3D changes for a button when the mouse moves over it.

If I would have a way to query boundings/hotspot for current pointer, I guess the problem will be solved. Is there a way to query these?

Thanks,
Paul