News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

AnimateWindow

Started by hfheatherfox07, August 17, 2011, 01:46:19 AM

Previous topic - Next topic

dedndave

ok - starting from scratch   :bg

first, let's have a look at the batch file
%MASMBINPATH%\link.exe /SUBSYSTEM:WINDOWS /OUT:"%file%.exe" %file%.obj rsrc.res
the MS linker requires an OBJ
PoLink can use a RES file

i prefer to end the batch file with PAUSE rather than running the program so you can see any errors before continuing
being a n00b, i get lots of errors   :P

now, for animated windows, i suspect we need to use InitCommonControls or InitCommonControlsEx
i usually make it the first thing in the program
        push    ICC_WIN95_CLASSES
        push    sizeof INITCOMMONCONTROLSEX
        INVOKE  InitCommonControlsEx,esp
        pop     ecx
        pop     edx

you could add
or ICC_STANDARD_CLASSES
but, not sure it's needed

after that, i tried using drizz's and Edgar's method with setting the window region
some of these functions require gdi32.inc/lib
for some reason, it changes the theme to the old "classic win95" theme
Edgar uses a WS_POPUP style - that may be the reason

ToutEnMasm

Found,
Quote
INVOKE AnimateWindow, hwnd, 300, AW_CENTER or AW_BLEND
No problem until we clic the window

dedndave

AW_BLEND cannot be combined with AW_CENTER

i give up - lol

ToutEnMasm

copy of msdn
I don't see that
Quote
AW_ACTIVATE
0x00020000 Activates the window. Do not use this value with AW_HIDE.

AW_BLEND
0x00080000 Uses a fade effect. This flag can be used only if hwnd is a top-level window.

AW_CENTER
0x00000010 Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used. The various direction flags have no effect.

AW_HIDE
0x00010000 Hides the window. By default, the window is shown.

AW_HOR_POSITIVE
0x00000001 Animates the window from left to right. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.

AW_HOR_NEGATIVE
0x00000002 Animates the window from right to left. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.

AW_SLIDE
0x00040000 Uses slide animation. By default, roll animation is used. This flag is ignored when used with AW_CENTER.

AW_VER_POSITIVE
0x00000004 Animates the window from top to bottom. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.

AW_VER_NEGATIVE
0x00000008 Animates the window from bottom to top. This flag can be used with roll or slide animation. It is ignored when used with AW_CENTER or AW_BLEND.


ToutEnMasm


Msdn say that the windows must :
Quote
The window procedures for the window and its child windows should handle any WM_PRINT or WM_PRINTCLIENT messages. Dialog boxes, controls, and common controls already handle WM_PRINTCLIENT. The default window procedure already handles WM_PRINT.
But what to do with the WM_PRINT message ?

dedndave

i don't know where i saw it, Yves
but AW_BLEND overrides AW_CENTER

hfheatherfox07

Quote from: dedndave on August 17, 2011, 04:54:07 AM
lol
this isn't even close to what i was aiming for, but, the corner problem is gone   :bg

i tried Edgar's solution from this thread - then played with the numbers...
http://www.masm32.com/board/index.php?topic=16410.msg135986#msg135986

No that does not solve the corner problem...you are using a tool model window (square one)
the idea is not to have the rounded corner window show the black corners ....

jj2007

Try this in line 67. On Win XP SP3 it works fine. No black corners.

  invoke CreateRoundRectRgn,-1,-1,edx,eax,70,70
  invoke SetWindowRgn,hWnd,eax,TRUE

hfheatherfox07

Quote from: jj2007 on August 17, 2011, 10:43:47 PM
Try this in line 67. On Win XP SP3 it works fine. No black corners.

  invoke CreateRoundRectRgn,-1,-1,edx,eax,70,70
  invoke SetWindowRgn,hWnd,eax,TRUE


Thanks that did it  :bg


hfheatherfox07

Quote from: dedndave on August 17, 2011, 04:05:28 AM
with slide, as well as some others, you must also specify a direction flag

Yap  :bg

AW_SLIDE works with :

AW_HOR_POSITIVE
AW_HOR_NEGATIVE
AW_VER_POSITIVE
AW_VER_NEGATIVE

For example:

  INVOKE AnimateWindow, hWnd, 300,AW_SLIDE or AW_HOR_POSITIVE

:U

dedndave

nice job, Jochen   :U