Author Topic: AnimateWindow proc or The AnimateProc function  (Read 7709 times)

hfheatherfox07

  • Member
  • ***
  • Posts: 464
AnimateWindow proc or The AnimateProc function
« 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
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: AnimateWindow proc or The AnimateProc function
« Reply #1 on: August 27, 2012, 02:32:40 AM »
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

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: AnimateWindow proc or The AnimateProc function
« Reply #2 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
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: AnimateWindow proc or The AnimateProc function
« Reply #3 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

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: AnimateWindow proc or The AnimateProc function
« Reply #4 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
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: AnimateWindow proc or The AnimateProc function
« Reply #5 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 ......
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

ragdog

  • Member
  • ****
  • Posts: 610
Re: AnimateWindow proc or The AnimateProc function
« Reply #6 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]

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: AnimateWindow proc or The AnimateProc function
« Reply #7 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

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: AnimateWindow proc or The AnimateProc function
« Reply #8 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
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: AnimateWindow proc or The AnimateProc function
« Reply #9 on: August 27, 2012, 03:13:20 AM »
For Example I want to animate some text form center out
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: AnimateWindow proc or The AnimateProc function
« Reply #10 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 ?"
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: AnimateWindow proc or The AnimateProc function
« Reply #11 on: August 27, 2012, 03:41:35 AM »
I'm afraid that AnimateWindow() isn’t designed for such usage...
MREAL macros - when you need floating point arithmetic while assembling!

hfheatherfox07

  • Member
  • ***
  • Posts: 464
Re: AnimateWindow proc or The AnimateProc function
« Reply #12 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 .....

 :(
« Last Edit: August 27, 2012, 02:01:45 PM by hfheatherfox07 »
Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

ragdog

  • Member
  • ****
  • Posts: 610
Re: AnimateWindow proc or The AnimateProc function
« Reply #13 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

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: AnimateWindow proc or The AnimateProc function
« Reply #14 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.
MREAL macros - when you need floating point arithmetic while assembling!