i found these function in net for read animated cursors, but the real one change the system cursor. but i wanted put(draw) the subimages in a picturebox array.
in my new changes i have incompleted DrawIconEx(i don't know use these API function) arguments.
and i don't know if there is more errors.
can anyone help me finish these function?
thanksCode:Option Explicit Private Declare Function LoadCursorFromFile Lib "user32" Alias _ "LoadCursorFromFileA" (ByVal lpFileName As String) As Long Private Declare Function GetCursor Lib "user32" () As Long Private Declare Function CopyIcon Lib "user32" (ByVal hcur As Long) As Long Private mlngOldCursor As Long, lngNewCursor As Long Private Declare Function DrawIconEx Lib "user32" (ByVal hdc As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long Public Sub AnimatedCursor(AniFilePath As String, picDestany As Variant) Static i As Long i = i + 1 'Create a copy of the current cursor, 'for Windows NT compatibility mlngOldCursor = CopyIcon(GetCursor()) 'Check the passed string, if it contains 'a solid file path, then load the cursor 'from file. If not, add the App.Path, '*then* load cursor... If InStr(1, AniFilePath, "\") Then lngNewCursor = LoadCursorFromFile(AniFilePath) Else lngNewCursor = LoadCursorFromFile(App.Path & _ "\" & AniFilePath) End If 'Activate the cursor Load picDestany(i) drawiconex picDestany(i).hdc,0,0, lngNewCursor, End Sub





Reply With Quote