ow
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CDirectShowEventDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CDirectShowEventDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CDirectShowEventDlg::OnOK()
{
}
void CDirectShowEventDlg::OnSetFile()
{
CFileDialog fDlg(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
"avi文件|*.avi;*.dat;*.mp3;*.wav;*.mpeg|所有文件|*.*||",this);
if (fDlg.DoModal()==IDOK)
{
m_FileName = fDlg.GetPathName();
m_Stop.SendMessage(WM_LBUTTONDOWN,0,0);
PlayFile(m_FileName);
}
}
void CDirectShowEventDlg::OnCancel()
{
OnTbStop() ;
m_DisplayWnd.DestroyWindow();
CDialog::OnCancel();
}
void CDirectShowEventDlg::Done(WPARAM wParam, LPARAM lParam)
{
if (m_hThread)
{
TerminateThread(m_hThread,0);
m
上一篇:
bjUnit.pas
下一篇:
吉利PHEV家族震撼亮相2019深港澳车展,彰显新能源王牌军团实力