Results 1 to 6 of 6

Thread: Animate Window API Problem

  1. #1

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hi, I tried to use the animatewindow API. But when i unload my form, i got an error message saying,

    "Can't find Dll entry point in animatewindow in user32"

    What could be the reason? Here is my code:

    ---------------------------------
    Const AW_HOR_POSITIVE = &H1 'Animates the window from left to right. This flag can be used with roll or slide animation.
    Const AW_HOR_NEGATIVE = &H2 'Animates the window from right to left. This flag can be used with roll or slide animation.
    Const AW_VER_POSITIVE = &H4 'Animates the window from top to bottom. This flag can be used with roll or slide animation.
    Const AW_VER_NEGATIVE = &H8 'Animates the window from bottom to top. This flag can be used with roll or slide animation.
    Const AW_CENTER = &H10 'Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used.
    Const AW_HIDE = &H10000 'Hides the window. By default, the window is shown.
    Const AW_ACTIVATE = &H20000 'Activates the window.
    Const AW_SLIDE = &H40000 'Uses slide animation. By default, roll animation is used.
    Const AW_BLEND = &H80000 'Uses a fade effect. This flag can be used only if hwnd is a top-level window.
    Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, ByVal dwTime As Long, ByVal dwFlags As Long) As Boolean
    Private Sub Form_Load()
    Me.AutoRedraw = True
    Me.Print "Unload me"
    End Sub
    Private Sub Form_Unload(Cancel As Integer)
    'Animate the window
    AnimateWindow Me.hwnd, 200, AW_VER_POSITIVE Or AW_HOR_NEGATIVE Or AW_HIDE
    'Unload our form completely
    Set Form1 = Nothing
    End Sub

    --------------

    Venkat.

  2. #2
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    I program of mine does that too.... On some machines...

    I just compiled your program and it worked..

    I think it 's not the code but it's the machine...

    Do you have a Win95 OS maybe ??
    My program never worked on Win95 but does in Win98...

    You can however do about the same trick with a simple For loop...


  3. #3

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hi I Use Win NT. Any solutions??
    Pls..

  4. #4
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    Maybe updating your system will help -->
    IE 5, service packs etc...

    if not.... I reckon the code is only fully compatible with win98..

    You can still mimick it with a for loop.

    Get the width and height and top and left of the window then hide the window and show a window with the same width, height, top and left but with it's borderstyle set to 0 (make the backcolor black)

    Then do something like this to the window you just spawned :

    Code:
        dim iCounter as integer
        Form2.Height = 5000
        Form2.Width = 5000
    
        For iCounter = 5000 To 1 Step -1
            Form2.Height = iCounter
            Form2.Width = iCounter
            Form2.Top = Form2.Top + 1
            DoEvents
        Next iCounter
    
        Unload Form2
    [This message has been edited by Inhumanoid (edited 12-03-1999).]

  5. #5
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    hey venkatraman_r,

    I just found out... Animatewindow is Windows 98 and Windows 2000 only ....

    B.T.W. It's fun like this :

    Code:
    For iCounter = 5000 To 1 Step -4
            Form1.Height = iCounter
            Form1.Width = iCounter
            Form1.Top = Form1.Top + 2
            Form1.Left = Form1.Left + 2
            DoEvents
        Next iCounter
    [This message has been edited by Inhumanoid (edited 12-03-1999).]

  6. #6

    Thread Starter
    Hyperactive Member venkatraman_r's Avatar
    Join Date
    Jul 1999
    Location
    Chennai, INDIA
    Posts
    284

    Post

    Hi Inhumanoid,

    Thanx for your help....i hope i would find a better way to animate a form other than this API and thanx for the informations.

    Regards,

    Venkat

Posting Permissions

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



Click Here to Expand Forum to Full Width