Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Animation in Userform

is it Possibel to get a Animation Picture in a Userform

Animation like a Printer Working or som thing like that
--
Henrik Christensen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 214
Default Animation in Userform

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" a écrit dans le message de news:
...
is it Possibel to get a Animation Picture in a Userform

Animation like a Printer Working or som thing like that
--
Henrik Christensen



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Animation Andy pop Excel Programming 2 November 16th 04 02:41 PM
Animation No Name Excel Programming 2 July 15th 04 11:14 PM
Userform animation Jeff Standen Excel Programming 2 May 5th 04 06:06 PM
Animation Adam Klee Excel Programming 3 August 12th 03 01:15 PM
animation Adam Klee Excel Programming 0 August 12th 03 08:04 AM


All times are GMT +1. The time now is 08:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"