diff --git a/PInvoke/User32/WinUser.Cursor.cs b/PInvoke/User32/WinUser.Cursor.cs index 516dcd69..0f536d01 100644 --- a/PInvoke/User32/WinUser.Cursor.cs +++ b/PInvoke/User32/WinUser.Cursor.cs @@ -500,6 +500,120 @@ namespace Vanara.PInvoke [PInvokeData("winuser.h", MSDNShortId = "loadcursor")] public static extern SafeHCURSOR LoadCursor(HINSTANCE hInstance, string lpCursorName); + /// + /// Loads the specified cursor resource from the executable (.EXE) file associated with an application instance. + /// Note This function has been superseded by the LoadImage function. + /// + /// + /// Type: HINSTANCE + /// A handle to an instance of the module whose executable file contains the cursor to be loaded. + /// + /// + /// Type: LPCTSTR + /// + /// The name of the cursor resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the + /// low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can also be used to create this value. To use one of + /// the predefined cursors, the application must set the hInstance parameter to NULL and the lpCursorName parameter to one the + /// following values. + /// + /// + /// + /// Value + /// Meaning + /// + /// + /// IDC_APPSTARTING MAKEINTRESOURCE(32650) + /// Standard arrow and small hourglass + /// + /// + /// IDC_ARROW MAKEINTRESOURCE(32512) + /// Standard arrow + /// + /// + /// IDC_CROSS MAKEINTRESOURCE(32515) + /// Crosshair + /// + /// + /// IDC_HAND MAKEINTRESOURCE(32649) + /// Hand + /// + /// + /// IDC_HELP MAKEINTRESOURCE(32651) + /// Arrow and question mark + /// + /// + /// IDC_IBEAM MAKEINTRESOURCE(32513) + /// I-beam + /// + /// + /// IDC_ICON MAKEINTRESOURCE(32641) + /// Obsolete for applications marked version 4.0 or later. + /// + /// + /// IDC_NO MAKEINTRESOURCE(32648) + /// Slashed circle + /// + /// + /// IDC_SIZE MAKEINTRESOURCE(32640) + /// Obsolete for applications marked version 4.0 or later. Use IDC_SIZEALL. + /// + /// + /// IDC_SIZEALL MAKEINTRESOURCE(32646) + /// Four-pointed arrow pointing north, south, east, and west + /// + /// + /// IDC_SIZENESW MAKEINTRESOURCE(32643) + /// Double-pointed arrow pointing northeast and southwest + /// + /// + /// IDC_SIZENS MAKEINTRESOURCE(32645) + /// Double-pointed arrow pointing north and south + /// + /// + /// IDC_SIZENWSE MAKEINTRESOURCE(32642) + /// Double-pointed arrow pointing northwest and southeast + /// + /// + /// IDC_SIZEWE MAKEINTRESOURCE(32644) + /// Double-pointed arrow pointing west and east + /// + /// + /// IDC_UPARROW MAKEINTRESOURCE(32516) + /// Vertical arrow + /// + /// + /// IDC_WAIT MAKEINTRESOURCE(32514) + /// Hourglass + /// + /// + /// + /// + /// Type: HCURSOR + /// If the function succeeds, the return value is the handle to the newly loaded cursor. + /// If the function fails, the return value is NULL. To get extended error information, call GetLastError. + /// + /// + /// + /// The LoadCursor function loads the cursor resource only if it has not been loaded; otherwise, it retrieves the handle to + /// the existing resource. This function returns a valid cursor handle only if the lpCursorName parameter is a pointer to a cursor + /// resource. If lpCursorName is a pointer to any type of resource other than a cursor (such as an icon), the return value is not + /// NULL, even though it is not a valid cursor handle. + /// + /// + /// The LoadCursor function searches the cursor resource most appropriate for the cursor for the current display device. The + /// cursor resource can be a color or monochrome bitmap. + /// + /// DPI Virtualization + /// This API does not participate in DPI virtualization. The output returned is not affected by the DPI of the calling thread. + /// Examples + /// For an example, see Creating a Cursor. + /// + // https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-loadcursora HCURSOR LoadCursorA( HINSTANCE hInstance, + // LPCSTR lpCursorName ); + [DllImport(Lib.User32, SetLastError = true, CharSet = CharSet.Auto)] + [PInvokeData("winuser.h", MSDNShortId = "loadcursor")] + public static extern SafeHCURSOR LoadCursor(HINSTANCE hInstance, ResourceId lpCursorName); + /// /// Creates a cursor based on data contained in a file. ///