Курсовая работа: Проектування користувальницького інтерфейсу в C++ Builder
void __fastcall TForm2::FormClose(TObject *Sender, TCloseAction &Action)
{
/* Timer1->Enabled = false;
*/
if (ghRC)
wglDeleteContext(ghRC);
if (ghDC)
ReleaseDC(Handle, ghDC);
MediaPlayer1->Close();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::FormCreate(TObject *Sender)
{
ghDC = GetDC(Handle);
if (!bSetupPixelFormat(ghDC))
Close();
ghRC = wglCreateContext(ghDC);
wglMakeCurrent(ghDC, ghRC);
initializeGL(ClientRect.Right, ClientRect.Bottom);
MediaPlayer1->Open();
MediaPlayer1->Play();
ProgressBar1->Position = 0;
}
//---------------------------------------------------------------------------
void __fastcall TForm2::FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
MediaPlayer1->Close();
Close();