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

Hi Hotbird;
For example:
Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long _
, ByVal dwTime As Long, ByVal dwFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const AW_HOR_POSITIVE = &H1
Private Const AW_HOR_NEGATIVE = &H2
Private Const AW_VER_POSITIVE = &H4
Private Const AW_VER_NEGATIVE = &H8
Private Const AW_CENTER = &H10
Private Const AW_HIDE = &H10000
Private Const AW_ACTIVATE = &H20000
Private Const AW_SLIDE = &H40000
Private Const AW_BLEND = &H80000
Public objForm As UserForm1


Sub RollDiagPos()
Dim lngHwnd As Long
Dim lngRet As Long
Set objForm = New UserForm1
lngHwnd = FindWindow(vbNullString, objForm.Caption)
lngRet = AnimateWindow(lngHwnd, 600, AW_HOR_POSITIVE + _
AW_VER_POSITIVE + AW_ACTIVATE)
End Sub

MP

"Hotbird" a écrit dans le message de
...



Copyright © 1998-2002, The KPD-Team


Have just found this sample API code, which I have cut and pasted to a
Module attached to a blank spreadsheet. When I attempt to run the

Form_Load
procedure, it returns Compile error: invalid use of Me keyword. Being new
to API programmming, I am unsure how to run the sample. Have tried
attaching a Form, but to no effect. Can anyone point me in the right
direction?

Many thanks

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()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail:
'Set the graphic mode to persistent
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





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Window Animation

Thank you Michel for this version of the code. It now runs for me, and I
have been able to create the different effects of roll up/down/left right as
well as fading. Very interesting and thank you.


"Michel Pierron" wrote in message
...
Hi Hotbird;
For example:
Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long _
, ByVal dwTime As Long, ByVal dwFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const AW_HOR_POSITIVE = &H1
Private Const AW_HOR_NEGATIVE = &H2
Private Const AW_VER_POSITIVE = &H4
Private Const AW_VER_NEGATIVE = &H8
Private Const AW_CENTER = &H10
Private Const AW_HIDE = &H10000
Private Const AW_ACTIVATE = &H20000
Private Const AW_SLIDE = &H40000
Private Const AW_BLEND = &H80000
Public objForm As UserForm1


Sub RollDiagPos()
Dim lngHwnd As Long
Dim lngRet As Long
Set objForm = New UserForm1
lngHwnd = FindWindow(vbNullString, objForm.Caption)
lngRet = AnimateWindow(lngHwnd, 600, AW_HOR_POSITIVE + _
AW_VER_POSITIVE + AW_ACTIVATE)
End Sub

MP



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Window Animation

Hotbird,
l tried to send you the scrolling file to the email address below...
but l keep getting it sent back....

"Hotbird" wrote in message news:<c_nJb.7217
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
The window opens in a smaller window not full sized window. Rachael Excel Discussion (Misc queries) 0 November 7th 06 09:04 PM
Animation Weave New Users to Excel 1 December 7th 05 02:21 PM
Window Animation Tom Ogilvy Excel Programming 4 January 4th 04 03:34 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 02:13 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"