Поделиться через


CWinApp::LoadCursor

Loads the cursor resource named by lpszResourceName or specified by nIDResource from the current executable file.

HCURSOR LoadCursor(
   LPCTSTR lpszResourceName 
) const;
HCURSOR LoadCursor(
   UINT nIDResource 
) const;

Параметры

  • lpszResourceName
    Points to a null-terminated string that contains the name of the cursor resource. You can use a CString for this argument.

  • nIDResource
    ID of the cursor resource. For a list of resources, see LoadCursor in the Windows SDK.

Возвращаемое значение

A handle to a cursor if successful; otherwise NULL.

Заметки

LoadCursor loads the cursor into memory only if it has not been previously loaded; otherwise, it retrieves a handle of the existing resource.

Use the LoadStandardCursor or LoadOEMCursor member function to access the predefined Windows cursors.

Пример

HCURSOR hCursor;

// Load a cursor resource that was originally created using
// the Graphics Editor and assigned the i.d. IDC_MYCURSOR.
hCursor = AfxGetApp()->LoadCursor(IDC_MYCURSOR);

Требования

Header: afxwin.h

См. также

Основные понятия

CWinApp Class

CWinApp Members

Hierarchy Chart

CWinApp::LoadStandardCursor

CWinApp::LoadOEMCursor

LoadCursor