반응형
AnimateWindow
윈도우에 효과를 주어 사라지고 등장하게 해 주는 API 이다.
함수 설명 ( 출처 : MSDN )
첫 번째 인자인 hwnd 는 효과를 적용하기위한 윈도우의 핸들이다.
두 번째 인자인 dwTime 은 지정된 효과를 수행할 시간으로 밀리세컨드 단위로 입력한다. 입력값이 작을 수록 에니메이션 효과의 시간이 짧아 지므로 에니메이션이 빠르게 동작한다.
세 번째 인자는 효과의 종류이다.
윈도우에 효과를 주어 사라지고 등장하게 해 주는 API 이다.
함수 설명 ( 출처 : MSDN )
Syntax
BOOL AnimateWindow(
HWND hwnd,
DWORD dwTime,
DWORD dwFlags
);
Parameter 설명 보기
Parameters
hwnd
[in] Handle to the window to animate.
The calling thread must own this window.
dwTime
[in] Specifies how long it takes to play the animation, in milliseconds.
Typically, an animation takes 200 milliseconds to play.
dwFlags
[in] Specifies the type of animation.
This parameter can be one or more of the following values.
Note that, by default, these flags take effect when showing a window.
To take effect when hiding a window,
use AW_HIDE and a logical OR operator with the appropriate flags.
AW_SLIDE
Uses slide animation. By default, roll animation is used.
This flag is ignored when used with AW_CENTER.
AW_ACTIVATE
Activates the window. Do not use this value with AW_HIDE.
AW_BLEND
Uses a fade effect.
This flag can be used only if hwnd is a top-level window.
AW_HIDE
Hides the window. By default, the window is shown.
AW_CENTER
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_HOR_POSITIVE
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
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_VER_POSITIVE
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
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.
첫 번째 인자인 hwnd 는 효과를 적용하기위한 윈도우의 핸들이다.
두 번째 인자인 dwTime 은 지정된 효과를 수행할 시간으로 밀리세컨드 단위로 입력한다. 입력값이 작을 수록 에니메이션 효과의 시간이 짧아 지므로 에니메이션이 빠르게 동작한다.
세 번째 인자는 효과의 종류이다.
- AW_SLIDE : 기본 인자로 에니메이션 효과를 의미하며 생략해도 슬리이딩 효과가 있는 것 같다. AW_CENTER 가 함께 적용되면 무시된다.
- AW_ACTIVATE : 윈도우을 활성화 한다. AW_HIDE와 사용하지 않는다.
- AW_BLEND : Fading 효과
- AW_HIDE : 윈도우를 사라지게 한다.
- AW_CENTER : 윈도우의 가운데 점을 기준으로 효과를 적용한다.
- AW_HOR_POSITIVE : 윈도우를 좌에서 우로 사라지게 또는 보이게 함.
- AW_HOR_NEGATIVE : 윈도우를 우에서 좌로 사라지게 또는 보이게 함.
- AW_VER_POSITIVE : 윈도우를 위에서 아래로 사라지게 또는 보이게 함.
- AW_VER_NEGATIVE : 윈도우를 아래에서 위로 사라지게 또는 보이게 함.
01.
//---------------------------------------------------------------------------
02.
void
__fastcall TfrmMain::btnBlendClick(TObject *Sender)
03.
{
04.
// Blending
05.
AnimateWindow( Handle, 1000, AW_HIDE | AW_BLEND );
06.
Sleep(1000);
07.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_BLEND );
08.
}
09.
//---------------------------------------------------------------------------
10.
void
__fastcall TfrmMain::btnCenterClick(TObject *Sender)
11.
{
12.
// Center
13.
AnimateWindow( Handle, 1000, AW_HIDE | AW_CENTER );
14.
Sleep(1000);
15.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_CENTER );
16.
}
17.
//---------------------------------------------------------------------------
18.
void
__fastcall TfrmMain::btnHPosClick(TObject *Sender)
19.
{
20.
// Horizontal Positive
21.
AnimateWindow( Handle, 1000, AW_HIDE | AW_HOR_POSITIVE );
22.
Sleep(1000);
23.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_HOR_POSITIVE );
24.
}
25.
//---------------------------------------------------------------------------
26.
void
__fastcall TfrmMain::btnHNegClick(TObject *Sender)
27.
{
28.
// Horizontal Negative
29.
AnimateWindow( Handle, 1000, AW_HIDE | AW_HOR_NEGATIVE );
30.
Sleep(1000);
31.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_HOR_NEGATIVE );
32.
}
33.
//---------------------------------------------------------------------------
34.
void
__fastcall TfrmMain::btnVPosClick(TObject *Sender)
35.
{
36.
// Vertical Positive
37.
AnimateWindow( Handle, 1000, AW_HIDE | AW_VER_POSITIVE );
38.
Sleep(1000);
39.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_VER_POSITIVE );
40.
}
41.
//---------------------------------------------------------------------------
42.
void
__fastcall TfrmMain::btnVNegClick(TObject *Sender)
43.
{
44.
// Vertical Negative
45.
AnimateWindow( Handle, 1000, AW_HIDE | AW_VER_NEGATIVE );
46.
Sleep(1000);
47.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_VER_NEGATIVE );
48.
}
49.
//---------------------------------------------------------------------------
50.
void
__fastcall TfrmMain::btnHPosVPosClick(TObject *Sender)
51.
{
52.
AnimateWindow( Handle, 1000, AW_HIDE | AW_HOR_POSITIVE | AW_VER_POSITIVE );
53.
Sleep(1000);
54.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_HOR_POSITIVE | AW_VER_POSITIVE );
55.
}
56.
//---------------------------------------------------------------------------
57.
void
__fastcall TfrmMain::btnHNegVNegClick(TObject *Sender)
58.
{
59.
AnimateWindow( Handle, 1000, AW_HIDE | AW_HOR_NEGATIVE | AW_VER_NEGATIVE );
60.
Sleep(1000);
61.
AnimateWindow( Handle, 1000, AW_SLIDE | AW_HOR_NEGATIVE | AW_VER_NEGATIVE );
62.
}
63.
//---------------------------------------------------------------------------
반응형
'소프트웨어 > C,VC++' 카테고리의 다른 글
CTreeCtrl 검색하기 (0) | 2009.11.11 |
---|---|
Visual Basic 에서 C/C++로 만든 DLL 불러쓰기 (0) | 2009.06.16 |
플러그인과 자바스크립트의 연동! (0) | 2009.03.27 |
Active X에 대응한다! Fire Fox 플러그인 만들기(3) (0) | 2009.03.27 |
Active X에 대응한다! Fire Fox 플러그인 만들기(2) (0) | 2009.03.27 |