ahhh yes, now I see why ... it is for this reason...
Uses slide animation. By default, roll animation is used. This flag is ignored when used with AW_CENTER.
This is because AW_SLIDE is used combined with other mode except with AW_CENTER.
I made other adaptations to exemplify all modes (including mixed mode):
Code: Select all
/*
Note that this function does not work correctly on windows
vista/7 with the aero theme enabled.
*/
#include "hmg.ch"
Function Main
Local nMiliseconds := 1000 , I
Local aFlag:={0x00000001, 0x00000002, 0x00000004,;
0x00000008, 0x00000010, 0x00080000,;
0x00000004+0x00000001+0x00040000,;
0x00000004+0x00000002+0x00040000,;
0x00000008+0x00000001+0x00040000,;
0x00000008+0x00000002+0x00040000}
Local aMode:={"Left to Right"+CRLF+"(0x00000001)",;
"Right to Left"+CRLF+"(0x00000002)",;
"Top to Bottom"+CRLF+"(0x00000004)",;
"Bottom to Top"+CRLF+"(0x00000008)",;
"From Center"+CRLF+"(0x00000010)",;
"Fade"+CRLF+"(0x00080000)",;
"Top Left Down"+CRLF+ "(0x00000004+0x00000001+0x00040000)",;
"Top Right Down"+CRLF+"(0x00000004+0x00000002+0x00040000)",;
"Down Left Top"+CRLF+ "(0x00000008+0x00000001+0x00040000)",;
"Down Right Top"+CRLF+"(0x00000008+0x00000002+0x00040000)"}
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 200 ;
MAIN TOPMOST
DEFINE BUTTON Button_1
ROW 60
COL 70
WIDTH 100
HEIGHT 28
ACTION MyMsgWait("Set Flash Window","Atenção",5)
CAPTION "Button_1"
FONTNAME "Arial"
FONTSIZE 9
TOOLTIP ""
FONTBOLD .F.
FONTITALIC .F.
FONTUNDERLINE .F.
FONTSTRIKEOUT .F.
ONGOTFOCUS Nil
ONLOSTFOCUS Nil
HELPID Nil
FLAT .F.
TABSTOP .T.
VISIBLE .T.
TRANSPARENT .F.
MULTILINE .F.
PICTURE Nil
PICTALIGNMENT TOP
END BUTTON
END WINDOW
CENTER WINDOW Form_1
For I=1 to 10
Form_1.Title:=SubStr(aMode[I],1,At(CRLF,aMode[I])-1)
If I=6
HB_IDLESLEEP( 1 )
Endif
AnimateWindow(Form_1.HANDLE, If(I=6,nMiliseconds+1600,nMiliseconds), aFlag[I])
Msginfo(aMode[I],If(I>6,"Mixed mode","Simple mode"))
Form_1.Hide
Next
Form_1.Show
Form_1.Title:="Set Window Transparent"
SET WINDOW Form_1 TRANSPARENT TO 150
MsgInfo("Set Window Transparent")
Form_1.Title:="Set Window to Opaque"
SET WINDOW Form_1 TO Opaque
MsgInfo("Set Window Opaque (Normal)")
Form_1.Title:="Flash Window"
FLASH WINDOW Form_1 CAPTION COUNT 20 INTERVAL 50
// MyMsgWait("Set Flash Window",,5)
// Inkey(2)
/* Need to implement a new MsgWait("Set Flash Window",,3)
thru a C function MessageBox, otherwise it will not
work before Main Window activated.*/
Form_1.Minimize
Form_1.Title:="Flash Window TaskBar"
FLASH WINDOW Form_1 TASKBAR COUNT 20 INTERVAL 100
MsgInfo("Set Flash TaskBar")
Form_1.Restore
Form_1.Title:="Set Window Normal (Demo Finish)"
ACTIVATE WINDOW Form_1
Return Nil
Function MyMsgWait(cMessage, cTitle, nTime)
Local I:=0, nHeight:=0, nLastLine:=0
Private lLoop := .T.
cMessage:=If(cMessage=Nil," ",cMessage)
cTitle:=If(cTitle=Nil,"Atenção",cTitle)
nTime:=If(nTime=Nil, 10 , nTime)
If IsWindowDefined(Upper("Form'"))
ThisWindow.Release()
Endif
nHeight:=((If((HMG_Len(cMessage)/68)-Int(HMG_Len(cMessage)/68)=0,Int(HMG_Len(cMessage)/68),Int(HMG_Len(cMessage)/68)+1))*40)+30
If nHeight <= 70
nHeight := 90
Endif
DEFINE WINDOW FormMsgWait AT 0,0 WIDTH 300 HEIGHT nHeight+35 ;
TITLE cTitle ICON 'info.bmp' MODAL NOSIZE ;
ON RELEASE If(lLoop,lLoop:=.F.,) ON INIT Counting(nTime)
ON KEY ESCAPE of FormMsgWait ACTION FormMsgWait.Release
For I:=1 TO MLCount(cMessage,68,8,.f.)
cTexLabel := 'Text'+Str(I,1)
nLastLine := nLastLine+20
@ nLastLine,06 LABEL &cTexLabel WIDTH 278 HEIGHT 16 ;
VALUE HMG_PADC(Alltrim(MemoLine(cMessage,68,I,8,.t.)),68) ;
FONT 'ARIAL' SIZE 10 CENTERALIGN
Next I
@ nLastLine+30,115 BUTTON Button_1 CAPTION '&Ok' ;
WIDTH 80 HEIGHT 30 ACTION (FormMsgWait.Release)
END WINDOW
CENTER WINDOW FormMsgWait
ACTIVATE WINDOW FormMsgWait
Return Nil
Function Counting(nSecs)
Local nSeconds := 0, nCount := nSecs
Do While nCount > -1 .and. lLoop
If Abs( Seconds() - nSeconds ) >= 1
FormMsgWait.Button_1.Caption:=LTrim(Str(nCount))+" Second"+If(nCount > 1, "s", "")
nSeconds := Seconds()
nCount--
Endif
Do Events
Enddo
If lLoop
lLoop := .F.
FormMsgWait.Release()
Endif
Return Nil
This source code, was updated with all new Visual Effects on Windows (Contributed by Dr. Claudio Soto).
This video shows almost everything in Windows XP, do not know why Fades effects and Main window (at the end of the video) are not shown..
[youtube]ymRWs-2eFig[/youtube]
This app/example at Windows 7, the effects are not same behavior...
Fades are only effects that works properly in Win7.