Hey guys, my game has a video-playing with is using WinApi:
HWND MCIWnd;
int 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 | MCIWNDF_NOMENU, NULL );
if (MCIWndOpen ( MCIWnd, lpstr, NULL ) != 0)
{
MessageBox(0,"Unable to play a video because of the game path is too long.","Error",MB_ICONASTERISK);
DestroyWindow ( MCIWnd );
return 0;
}
SetWindowPos ( MCIWnd, HWND_TOPMOST, OriginX, OriginY, Width, Height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
MCIWndPlay ( MCIWnd ); // plays device
int gvol = MCIWndGetVolume(MCIWnd);
MCIWndSetVolume(MCIWnd,Begunok[0].volume*10);
if ( length )
*length = MCIWndGetLength ( MCIWnd );
return 1; // good
}
// Calling
strcpy(buf,dbGetDir());
strcat(buf,"\\Scenario\\video.wmv");
dbCLS();
UINT length = 0;
PlayVideo ( g_pGlob->hWnd, buf, MainShift, MainShiftY, 1024, 768, &length);
MCIWndResume(MCIWnd);
dbWait ( length*39);
// End Calling
Alse I use the standart Windows video codec and .WMV container with the low quality, so it is running on every "clear" Windows including XP SP2 with the standart windows media player. But it just shows the black screen instead of video when I execute the game on empty (just with video card setted)PC with Windows XP SP2.
Can you please suggest guys what can I do to prevent whis bug?
Thanks.