Animation Control question
I'm using an animation control to show progress whilst deleting data from
a database.
If there is an error I want to show a message and pause the animation until
the message has been responded to. Using the stop and start properties on
the animation control causes the animation to restart at the start of the
avi clip. Does anyone know a way of restarting the clip where it was stopped?
treeve
Re: Animation Control question
"treeve",
I'm not sure if the control responds to APIs, but you can try this:
Private Const WM_USER = &H400
'// Standard messages
Public Const ACM_OPEN = (WM_USER + 100)
Public Const ACM_PLAY = (WM_USER + 101)
Public Const ACM_STOP = (WM_USER + 102)
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd
As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
The ACM_PLAY message accepts a range of frames to play in lParam (as a
packed DWORD). There's no way that I'm aware of through which you can
determine the frame at the time the clip stops, but you can probably
approximate. It's probably pretty complicated to do, since not even Windows
stops its clips on a message box or an error.
Call SendMessage(Control.hWnd, ACM_PLAY, Repetitions, ByVal (FromFrame Or
(ToFrame * &H10000)))
If you pass the FromFrame as the point you want it to start, -1 as the
ToFrame (to have the control go to the end of the clip) and -1 as the
repetitions it should work, at least theoretically :-) I didn't try it,
though.
--
.. . . . . . . . . . . . . . . . . . . . . .
Klaus H. Probst, MVP
http://www.vbbox.com/
http://www.mvps.org/ccrp/
Please post/reply to the newsgroup(s)
"treeve moss" <treevem@hotmail.com> wrote in message
news:3911435e$1@news.devx.com...
>
> I'm using an animation control to show progress whilst deleting data from
> a database.
>
> If there is an error I want to show a message and pause the animation
until
> the message has been responded to. Using the stop and start properties on
> the animation control causes the animation to restart at the start of the
> avi clip. Does anyone know a way of restarting the clip where it was
stopped?
>
> treeve
Re: Animation Control question
"treeve",
I'm not sure if the control responds to APIs, but you can try this:
Private Const WM_USER = &H400
'// Standard messages
Public Const ACM_OPEN = (WM_USER + 100)
Public Const ACM_PLAY = (WM_USER + 101)
Public Const ACM_STOP = (WM_USER + 102)
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd
As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
The ACM_PLAY message accepts a range of frames to play in lParam (as a
packed DWORD). There's no way that I'm aware of through which you can
determine the frame at the time the clip stops, but you can probably
approximate. It's probably pretty complicated to do, since not even Windows
stops its clips on a message box or an error.
Call SendMessage(Control.hWnd, ACM_PLAY, Repetitions, ByVal (FromFrame Or
(ToFrame * &H10000)))
If you pass the FromFrame as the point you want it to start, -1 as the
ToFrame (to have the control go to the end of the clip) and -1 as the
repetitions it should work, at least theoretically :-) I didn't try it,
though.
--
.. . . . . . . . . . . . . . . . . . . . . .
Klaus H. Probst, MVP
http://www.vbbox.com/
http://www.mvps.org/ccrp/
Please post/reply to the newsgroup(s)
"treeve moss" <treevem@hotmail.com> wrote in message
news:3911435e$1@news.devx.com...
>
> I'm using an animation control to show progress whilst deleting data from
> a database.
>
> If there is an error I want to show a message and pause the animation
until
> the message has been responded to. Using the stop and start properties on
> the animation control causes the animation to restart at the start of the
> avi clip. Does anyone know a way of restarting the clip where it was
stopped?
>
> treeve