How to use Win32 SetCursor() with WPF resource and HwndHost

Posted by Hank on Stack Overflow See other posts from Stack Overflow or by Hank
Published on 2012-08-28T03:36:27Z Indexed on 2012/08/28 3:38 UTC
Read the original article Hit count: 651

We have an HwndHost UIElement in our WPF application which is used to display Direct3d graphics, and the only way I have found to set a cursor for the HwndHost UIElment is to call the Win32 API SetCursor(). All of our cursors are resources in managed assemblies, and I would prefer to not change that, but I have not been able to find a way to load one of these cursors via any Win32 APIs like LoadImage().

Does anybody know how to get a handle(hCursor) to a cursor which is a resource in a managed assembly?

Or, is there another way to set a cursor on an HwndHost displaying Direct3D graphics?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about winapi