Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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] DWORDthat 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 MAKEINTRESOURCEmacro.

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 ResourceIdby calling MAKEINTRESOURCEwith a value of 300, you must create identifiers for the subsequent frames by calling MAKEINTRESOURCEwith 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 hInstanceis NULL and you set ResourceIdto 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 OS 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
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also