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

hfheatherfox07

hi,

here is a silly question... when using AnimateWindow ...if you don't use a square frame in the rsrc,.rc and you have a standard rounded corners windows it seems that when the gui.exe starts there is a black square shadow behind it until you click on it and move it... Why?

is that a default setting with the windows AnimateWindow command? is there a way to fix that?

dedndave


hfheatherfox07

Quote from: dedndave on August 17, 2011, 02:07:51 AM
our buddy MichaelW seems to have a fix....
http://www.freebasic.net/forum/viewtopic.php?p=122350&sid=8c74bd1d7ea0445517c00d5f7dcb10e7

and, he's on a different forum   :eek

Thank you ,
I will try this tonight when I get home....

hfheatherfox07

I am not so sure how he got this to work ...am  I missing something?

I get an rc error

I have that defined like this :

LOCAL rc:RECT
.IF uMsg == WM_INITDIALOG
invoke  GetWindowRect( hDlg, @rc )
invoke MoveWindow( hDlg, rc.left, rc.top, _
            rc.right-rc.left, _
            rc.bottom-rc.top, true )
  INVOKE AnimateWindow, hWnd, 300, AW_CENTER
  INVOKE SetFocus,hWnd

dedndave

i didn't see that you initialized the RECT structure
it does not need to be a struct - just stick some constants in there to test it   :P
something other than CW_USEDEFAULT

at any rate, this is very similar to a problem i saw while making a child window in an MDI
if i created the child during WM_CREATE, i got the exact same effect as you have
so - i moved the child-create out of WM_CREATE, until after UpdateWindow, and it fixed it

i am not sure what the best way would be to apply that in a dialog window

this guy seems to have played with it a lot
he has several posts in that thread
hard to read - i would copy/paste all that stuff into a text file
maybe there is something in there that will help...
http://www.ionicwind.com/forums/index.php/topic,3495.0.html

hfheatherfox07


dedndave

 :bg

invoke  GetWindowRect( hDlg, @rc )
invoke MoveWindow( hDlg, rc.left, rc.top, _
            rc.right-rc.left, _
            rc.bottom-rc.top, true )


try this...
        INVOKE  GetWindowRect,hDlg,addr rc
        mov     eax,rc.right
        mov     edx,rc.bottom
        sub     eax,rc.left
        sub     edx,rc.top
        INVOKE  MoveWindow,hDlg,rc.left,rc.top,eax,edx,TRUE


if that doesn't fly, try FALSE (capital letters)   :P

hfheatherfox07

That works with both TRUE and FALSE but does nothing for the black shadows?

hfheatherfox07

maybe that  method only works when used with a WinMain proc and a WndProc... maybe this method does not apply that in a dialog window?

dedndave

that could be right
maybe you can combine another flag
not too many to choose from
ignore the directions - they don't apply
ignore the ones that do not combine with AW_CENTER
that should leave only a few to try   :P

not a very technical approach, but hey !

msdn says not to use it with a drop-shadow - that doesn't seem to apply

hfheatherfox07

Well I am off home ... I will give that a try for sure ...
Coincidentally  I did mess around with AW_SLIDE instead of AW_CENTER to see what effect that had and I noticed it did nothing ???

dedndave

with slide, as well as some others, you must also specify a direction flag

dedndave

i am going to try a MoveWindow AFTER the Animate   :bg

dedndave

hmmmm
that didn't do what i expected

dedndave

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