Compartir a través de


LoadAnimatedCursor (Compact 2013)

3/28/2014

This function enables an application to define and load a customized, animated wait cursor.

Syntax

WINUSERAPI HCURSOR WINAPI LoadAnimatedCursor(
  HINSTANCE hInstance,
  DWORD ResourceId,
  int cFrames,
  int FrameTimeInterval
);

Parameters

  • hInstance
    [in] Handle to the instance of the module for which the executable file contains the bitmap that you want to load. You should use bitmaps that are 48 x 48 pixels only.
  • ResourceId
    [in] DWORD that specifies the resource identifier of the first bitmap that you want to use for the animated wait cursor. You must create the resource identifier by calling the MAKEINTRESOURCE macro.
  • cFrames
    [in] Integer that specifies the number of bitmaps that you want to use in the animation. You must order the bitmaps consecutively in the resource file, starting with the one identified by ResourceId. For example, if you created ResourceId by calling MAKEINTRESOURCE with a value of 300, you must create identifiers for the subsequent frames by calling MAKEINTRESOURCE with values of 301, 302, and so on.
  • FrameTimeInterval
    [in] Integer that specifies the amount of time, in milliseconds, that you want to display a frame before the next frame replaces it.

Return Value

The handle to the newly loaded wait cursor indicates success. Use this handle in subsequent calls to SetCursor. NULL indicates failure. To get extended error information, call GetLastError.

Remarks

If hInstance is NULL and you set ResourceId to IDC_WAIT, this function loads the default system wait cursor and ignores FrameTimeInterval.

You should only use a bitmap with a width and height of 48 pixels. If you use a bitmap of a different size, this function aligns the top-left pixel of the bitmap with the top-left pixel of the wait cursor window and draws only the portion of the bitmap that fits within a 48 x 48 pixel area.

This function is supported only if the OEM includes the Mouse catalog item in the run-time image. If the function is not supported, the function fails and returns the ERROR_CALL_NOT_IMPLEMENTED error.

Requirements

Header

windows.h

Library

Cursor.lib,
Mcursor.lib

See Also

Reference

Mouse Functions
LoadCursor
SetCursor
MAKEINTRESOURCE