The MASM Forum

General => The Campus => Topic started by: hfheatherfox07 on August 27, 2012, 02:23:09 AM

Title: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 02:23:09 AM
Hi,
Is there  AnimateWindow proc inside a copy of  user32.lib.asm ? If so where can I get my hands on it?

What I need is AnimateWindow proc

I have seen an example that I think they use that but to animate the text on the screen....So I was thinking to modify that proc to  "invoke SelectObject, ps.hdc, hFont"

In the win32 SDK Refrences I have found :

AnimateProc

Code: [Select]
2.0     

The AnimateProc function is an application-defined callback function that provides information to DrawPenDataEx on a periodic basis. The name AnimateProc serves only as a placeholder; the function can have any name.
BOOL CALLBACK AnimateProc( HPENDATA hpndt, UINT iStrk, UINT cPnt, UINT FAR * lpuSpeedPct, LPARAM lParam )

Parameters

hpndt

Handle to the pen data currently being drawn.

iStrk

Zero-based index to the stroke being drawn, or about to be drawn.

cPnt

Count of points already drawn in this stroke.

lpuSpeedPct

Address of the speed-percent value.

lParam

Application-specific data passed to the callback. This value is specified in ANIMATEINFO.

Return Value

The callback function must return TRUE to continue drawing the pen data. Returning FALSE stops animation immediately.

Comments

One of the parameters of DrawPenDataEx provides the address of this callback function. The application must create an instance of this function using the MakeProcInstance function, and ensure that it is exported in the module-definition (.DEF) file.
The application can monitor the state of animation or provide the user with an opportunity to change the speed of animation, including pausing it, using the value addressed by lpuSpeedPct.

The application can also pass application-specific information to the callback in lParam. For example, a handle to the DC
 (device context) can be passed.
Callbacks are made at the beginning of the stroke or time interval, before any drawing is done. However, if AI_SKIPUPSTROKES is specified, a callback is not made before up strokes.

See Also

DrawPenDataEx,  ANIMATEINFO
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: dedndave on August 27, 2012, 02:32:40 AM
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632669%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/ms632669%28v=vs.85%29.aspx)

it is in user32.dll, which is part of the operating system
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 02:35:03 AM
I think I did not make my self too clear ...

I am looking for the structure of it ...Like the structure of AW_ACTIVATE... so I can animate text that way not a window
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: dedndave on August 27, 2012, 02:38:05 AM
still not very clear - lol
a "structure" is a data type
AW_ANIMATE is an equate, and is described in that link i posted

what you may be after is the code for the procedure, which is "beyond the scope of this forum", as it would involve reversing the OS

but - you might want to look up the AlphaBlend function
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 02:42:57 AM
still not very clear - lol
a "structure" is a data type
AW_ANIMATE is an equate, and is described in that link i posted

what you may be after is the code for the procedure, which is "beyond the scope of this forum", as it would involve reversing the OS

but - you might want to look up the AlphaBlend function

I did not think that was reversing LOL ...I thought hutch had it in the user32.lib.asm
The only thing I reverse is my car LOL
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 02:47:27 AM
I did not think of this but maybe I can draw my text in a static and than select the static handle
I got to try it ......
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: ragdog on August 27, 2012, 02:59:11 AM
Code: [Select]
AnimOpen proc hWnd:dword
                              invoke GetTickCount
                              movzx eax,al
                              bswap eax
                              rol eax,4
                              movzx eax,al
                              or al,al
                              jnz @F
                             
                              add anim,10h
                             
                         @@:
                              add anim,eax
                       
                     
                               push    anim
                               push    1F4h
                               push    hWnd
                               call    AnimateWindow
                               ret
AnimOpen endp

AnimClose proc hWnd:dword
                               mov eax,anim
                               sub eax,30000h
                               
                               push    eax
                               push    1F4h
                               push    hWnd
                               call    AnimateWindow
                               ret


AnimClose endp


[code]
.elseif eax==WM_INITDIALOG
         
push hWnd
call AnimOpen

.ELSEIF eax == WM_CLOSE
 
push hWnd
call AnimClose
[/code]
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: dedndave on August 27, 2012, 03:08:21 AM
many of us do a little reversing from time to time - lol
in some cases, we just want to know which API functions are used to perform a specific task
then - we can figure it out from there
but - it saves time if you know which functions to research

i reverse yahoo messenger to remove the advertisements   8)
i just don't discuss it here, is all
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 03:10:32 AM
many of us do a little reversing from time to time - lol
in some cases, we just want to know which API functions are used to perform a specific task
then - we can figure it out from there
but - it saves time if you know which functions to research

i reverse yahoo messenger to remove the advertisements   8)
i just don't discuss it here, is all

Not to seem Stupid but I still have a lot to learn before I can even think of doing stuff like that LOL
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 03:13:20 AM
For Example I want to animate some text form center out
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 03:28:56 AM
Code: [Select]
AnimOpen proc hWnd:dword
                              invoke GetTickCount
                              movzx eax,al
                              bswap eax
                              rol eax,4
                              movzx eax,al
                              or al,al
                              jnz @F
                             
                              add anim,10h
                             
                         @@:
                              add anim,eax
                       
                     
                               push    anim
                               push    1F4h
                               push    hWnd
                               call    AnimateWindow
                               ret
AnimOpen endp

AnimClose proc hWnd:dword
                               mov eax,anim
                               sub eax,30000h
                               
                               push    eax
                               push    1F4h
                               push    hWnd
                               call    AnimateWindow
                               ret


AnimClose endp


[code]
.elseif eax==WM_INITDIALOG
         
push hWnd
call AnimOpen

.ELSEIF eax == WM_CLOSE
 
push hWnd
call AnimClose
[/code]

what is "anim" ?

just " anim dd ?"
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: qWord on August 27, 2012, 03:41:35 AM
I'm afraid that AnimateWindow() isn’t designed for such usage...
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 27, 2012, 03:51:10 AM
I'm afraid that AnimateWindow() isn’t designed for such usage...

Thank you !

I have seen an example that showed text animated the same way ...so I thought .....

 :(
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: ragdog on August 27, 2012, 04:05:34 AM
hfheatherfox07

It is not to easy animate a scroller like crazy words :biggrin:

What serach you really?

it gives 1000te ways of a gdi scroller
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: qWord on August 28, 2012, 05:06:41 AM
For Example I want to animate some text form center out
In the attachment a example that is using SetWorldTransform to "zoom" text in and out.
The code can be reused: all related code is stored in StaticHook.asm/inc.
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 28, 2012, 05:43:08 AM
WOW!
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 28, 2012, 06:20:59 AM
I am trying to do the same thing I saw in a youtube video for something to do  8)...Just the first text effect here  http://www.youtube.com/watch?v=75AHKaSPUD8

I have the second example in that video and I am sure that he manipulated the DrawTxt proc in about.asm to do this....

Quick change and I was able to make the text go up in a stright line ...and right to left ... but no idea what he did to make it start from center out

Title: Re: AnimateWindow proc or The AnimateProc function
Post by: dedndave on August 28, 2012, 01:12:50 PM
i seem to recall this subject in the old forum
you might give it a try

if it is a small sample, you can convert it to a wave file - then it is easy to load from resource
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: qWord on August 29, 2012, 12:20:52 AM
I would create this animation by corresponding text operation because the resulting text can be drawn with transparent background. The code in the example isn't very elegant, but it works.
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: hfheatherfox07 on August 29, 2012, 12:25:44 AM
Oh my God....
Title: Re: AnimateWindow proc or The AnimateProc function
Post by: dedndave on August 29, 2012, 03:56:56 AM
Oh my God....

lol

that is nice, qWord   :t