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?
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
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....
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
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
I tried a rect structure following this http://www.feiesoft.com/masm32/asmintro/workingwithstructures.html still an error :(
: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
That works with both TRUE and FALSE but does nothing for the black shadows?
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?
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
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 ???
with slide, as well as some others, you must also specify a direction flag
i am going to try a MoveWindow AFTER the Animate :bg
hmmmm
that didn't do what i expected
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
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
Found,
Quote
INVOKE AnimateWindow, hwnd, 300, AW_CENTER or AW_BLEND
No problem until we clic the window
AW_BLEND cannot be combined with AW_CENTER
i give up - lol
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.
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 ?
i don't know where i saw it, Yves
but AW_BLEND overrides AW_CENTER
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 ....
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
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
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
nice job, Jochen :U