taken from old TGC member, really sorry i don't remember the name
//this global variable must be defined
HWND MCIWnd;
void PlayVideo ( HWND hwnd_ParentWindow, LPSTR lpstr, int OriginX, int OriginY, int Width, int Height, UINT* length )
{
MCIWnd = MCIWndCreate ( hwnd_ParentWindow, GetModuleHandle(NULL),
WS_CHILD | WS_VISIBLE | MCIWNDF_NOTIFYMODE | MCIWNDF_NOPLAYBAR, NULL );
MCIWndOpen ( MCIWnd, lpstr, NULL ); // new device in window
SetWindowPos ( MCIWnd, HWND_TOPMOST, OriginX, OriginY, Width, Height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE );
MCIWndPlay ( MCIWnd ); // plays device
if ( length )
*length = MCIWndGetLength ( MCIWnd );
}
parameters:
1-parent window (usually include "globstruct.h" and pass g_pGlob->hWnd)
2-name of the file
3,4,5,6- x,y,width and height
7- optional parameter (can be NULL), length of the video will be returned using this parameter
usage:
very simple usage could be:
#include "globstruct.h"
HWND MCIWnd;
//...
//...
//...
//play video
UINT length = 0;
PlayVideo ( g_pGlob->hWnd, "MyVideo.avi", 0, 0, width, height, &length );
dbWait ( length );
DestroyWindow ( MCIWnd );
Your signature has been erased by a mod - Please reduce it to 600x120 maximum size