mouseCursor2
Change the mouse cursor.
[write-only property]
mouseCursor2([in] IUnknown *cursor)
This property sets the icon (a
Picture
object) used as
the mouse pointer.
Setting mouseCursor2
to Nothing
will reset
XpdfViewer back to its default mouse cursors.
Note: setting the mouseCursor2
property sets both the
normal and link cursors, so make sure to set
call mouseCursor2
first, and mouseLinkCursor2
second. To set just the normal (non-link) cursor, first
set mouseCursor2
, then set mouseLinkCursor2
to Nothing
.
The mouseCursor2
property is identical to the
mouseCursor
property, except for the declared argument type. This
works around a problem with IPicture marshaling in newer versions of
.NET. See the code example below.
C#:
System.Windows.Forms.Cursor cursor = ....;
viewer.mouseCursor2 = CursorConverter.convert(cursor);
// This wrapper allows us to use the GetIPictureFromCursor function,
// which is a protected member of the AxHost class.
class CursorConverter : System.Windows.Forms.AxHost
{
private CursorConverter() : base(string.Empty) { }
public static object convert(Cursor cursor)
{
return GetIPictureFromCursor(cursor);
}
}