-
애니메이션 컨트롤 - Win32GUI/컨트롤 2009. 1. 15. 22:14
#include <commctrl.h>
#pragma comment(lib, TEXT("comctl32.lib"))
#include "resource.h"
BOOL CALLBACK DlgProc(HWND hDlg,UINT iMessage,WPARAM wParam,LPARAM lParam)
{
switch (iMessage) {
case WM_INITDIALOG:
if (SendMessage(GetDlgItem(hDlg, IDC_ANIMATE1), ACM_OPEN, 0, (LPARAM)"filecopy.avi"))
SendMessage(GetDlgItem(hDlg, IDC_ANIMATE1), ACM_PLAY, -1, MAKELPARAM(0, -1));
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
EndDialog(hDlg,IDOK);
return TRUE;
case IDCANCEL:
EndDialog(hDlg,IDCANCEL);
return TRUE;
}
break;
}
return FALSE;
}
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
// {
InitCommonControls();
DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), NULL, DlgProc);
// }
return 0;
}
6.0 버전의 ComCtl32.dll를 사용하기 위해서 프로젝트에 "YourApp.exe.manifest" 파일을 포함하고 리소스 스크립트 파일에 다음 라인을 넣는다.
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.exe.manifest"
참조 사이트:
http://msdn.microsoft.com/en-us/library/ms997646.aspx#xptheming_topic4
http://www.codeproject.com/KB/winsdk/xptheme.aspx
http://www.codeproject.com/KB/static/gifanimation.aspx
http://www.codeproject.com/KB/miscctrl/cxwndanimate.aspx
http://jjjryu.tistory.com/entry/%EC%8A%A4%ED%83%9C%ED%8B%B1-%EC%BB%A8%ED%8A%B8%EB%A1%A4-Win32