is it Possibel to get a Animation Picture in a Userform
Animation like a Printer Working or som thing like that
--
Henrik Christensen
is it Possibel to get a Animation Picture in a Userform
Animation like a Printer Working or som thing like that
--
Henrik Christensen
Hi Henrik,
Wy not an animated cursor...
In the UserForm module:
Private Declare Function FindWindow& Lib "USER32" Alias _
"FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function CreateWindowEx& Lib "USER32" _
Alias "CreateWindowExA" (ByVal dwExStyle& _
, ByVal lpClassName$, ByVal lpWindowName$ _
, ByVal dwStyle&, ByVal x&, ByVal y&, ByVal nWidth& _
, ByVal nHeight&, ByVal hwndParent&, ByVal hMenu& _
, ByVal hInstance&, lpParam As Any)
Private Declare Function LoadCursorFromFile& Lib "USER32" _
Alias "LoadCursorFromFileA" (ByVal lpFileName As Any)
Private Declare Function SendMessage& Lib "USER32" _
Alias "SendMessageA" (ByVal hWnd&, ByVal wMsg& _
, ByVal wParam&, lParam As Any)
Private Declare Function DestroyWindow& Lib "USER32" (ByVal hWnd&)
Private hWnd&
Private Sub UserForm_Activate()
Dim Icon$, hIcon&, hMe&
Icon = ThisWorkbook.Path & "\Globe.ani"
If Dir(Icon) = "" Then Exit Sub
hIcon = LoadCursorFromFile(Icon)
hMe = FindWindow(vbNullString, Me.Caption)
' &H50000003 = WS_CHILD Or WS_VISIBLE Or SS_ICON
hWnd = CreateWindowEx(0, "Static", "", &H50000003 _
, ByVal 10, ByVal 10, 0, 0, hMe, 0, 0, ByVal 0)
' &H172 = STM_SETIMAGE / &H2 = IMAGE_CURSOR
SendMessage hWnd, &H172, &H2, ByVal hIcon
End Sub
Private Sub UserForm_QueryClose(Cancel%, CloseMode%)
If hWnd Then DestroyWindow hWnd
End Sub
Regards,
MP
"Henrik" <Henrik@discussions.microsoft.com> a écrit dans le message de news:
2FF58129-4490-41DF-9F4E-63C3D11B0A48@microsoft.com...
> is it Possibel to get a Animation Picture in a Userform
>
> Animation like a Printer Working or som thing like that
> --
> Henrik Christensen
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks