+ Reply to Thread
Results 1 to 2 of 2

Animation in Userform

  1. #1
    Henrik
    Guest

    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. #2
    Michel Pierron
    Guest

    Re: 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" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > is it Possibel to get a Animation Picture in a Userform
    >
    > Animation like a Printer Working or som thing like that
    > --
    > Henrik Christensen




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1