IVsUIShell2.GetVSCursor Method
Returns a handle to a cursor of a specified cursor type.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop.8.0 (in Microsoft.VisualStudio.Shell.Interop.8.0.dll)
Syntax
'Déclaration
Function GetVSCursor ( _
cursor As UInteger, _
<OutAttribute> ByRef phIcon As IntPtr _
) As Integer
'Utilisation
Dim instance As IVsUIShell2
Dim cursor As UInteger
Dim phIcon As IntPtr
Dim returnValue As Integer
returnValue = instance.GetVSCursor(cursor, _
phIcon)
int GetVSCursor(
uint cursor,
out IntPtr phIcon
)
int GetVSCursor(
[InAttribute] unsigned int cursor,
[OutAttribute] IntPtr% phIcon
)
abstract GetVSCursor :
cursor:uint32 *
phIcon:IntPtr byref -> int
function GetVSCursor(
cursor : uint,
phIcon : IntPtr
) : int
Parameters
- cursor
Type: System.UInt32
[in] A value from the __VSCURSORTYPE enumeration specifying the type of cursor to be returned.
- phIcon
Type: System.IntPtr%
[out] The 32-bit integer handle (HCURSOR) to the appropriate cursor.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From vsshell80.idl:
HRESULT IVsUIShell2::GetVSCursor(
[in] VSCURSORTYPE cursor,
[out] HCURSOR* phIcon
);
For a full discussion on best practices for choosing the correct types of cursors when designing a user interface see The Visual Studio UI Guidelines document.
VSPackages that are written in unmanaged code or C++ can directly use the cursor by using the standard Windows cursor management tools. For more information, see Cursors.
VSPackages that are written in managed code should instantiate an instance of the Cursor class by using the overload of its constructor that takes a handle to a cursor as an argument. For more information, see T:System.Windows.Forms.Cursor.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.