I found one workaround - go to the istepIfAniCur parameter of the DrawIconEx max UINT parameter . It is impossible for someone to create an animated cursor with 4,294,967,295 frames (perhaps for some kind of cursor movie :)
Using this fact, you can pass this value to the DrawIconEx function, which will return False if the cursor is animating (due to exceeding the frame range) and True if it is static, since it ignores the istepIfAniCur parameter. You must pass 0 to the diFlags parameter because there is no need to draw anything.
Here is a Delphi example:
if not DrawIconEx(Canvas.Handle, 0, 0, hCursor, 0, 0, High(Cardinal), 0, 0) then Caption := 'Cursor is animated ...' else Caption := 'Cursor is not animated ...';
And since I promised the C ++ tag here, my translation attempt
if (!DrawIconEx(this->Canvas->Handle, 0, 0, hCursor, 0, 0, UINT_MAX, NULL, 0)) this->Caption = "Cursor is animated ..."; else this->Caption = "Cursor is not animated ...";
Exceeding the frame range is also indicated by the OS ERROR_INVALID_PARAMETER error , which you can check using GetLastError when DrawIconEx fails.
user532231
source share