티스토리 뷰
API 동영상(AVI)
1. 동영상 재생 윈도우 생성
HWND MCIWndCreate(
HWND 부모윈도우 핸들,
HINSTANCE MCIWnd 위도우를 사용하는 인스턴스 핸들,
DWORD MCIWnd 윈도우 모양, // CreateWindowEx() 에서 사용하는 스타일도 혼용 가능
LPSTR 오픈할 데이터 파일이나 오픈할 MCI 디바이스 장치);
<윈도우 모양>
2. 동영상 재생
LONG MCIWndPlay(hWndVideo); // MCIWndCreate() 에서 만등 핸들
3. 동영상 중지
LONG MCIWndStop(hWndVideo); // MCIWndCreate() 에서 만등 핸들
4. 동영상 재생 윈도우 닫기
LONG MCIWndClose(hWndVideo);
5. 동영상 재생 윈도우 파괴
VOID MCIWndDestroy(hWndVideo);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 |
#include <Vfw.h>
#pragma comment(lib, "vfw32.lib")
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static HWND hWndVideo = 0;
TCHAR strMsg[128];
switch (message)
{
case WM_LBUTTONDOWN:
if (hWndVideo)
{
MCIWndClose(hWndVideo);
MCIWndDestroy(hWndVideo);
hWndVideo = 0;
}
hWndVideo = MCIWndCreate(hWnd, hInst, MCIWNDF_NOTIFYMODE | MCIWNDF_NOTIFYPOS, L"동영상파일.avi");
if (hWndVideo)
MCIWndPlay(hWndVideo);
break;
|
cs |