資源簡介
用VS2010寫的一個視頻播放器,用的是windows media player
代碼片段和文件信息
//?MyButton.cpp?:?實現文件
//
#include?“stdafx.h“
#include?“MyNewPlayer.h“
#include?“MyButton.h“
//?CMyButton
IMPLEMENT_DYNAMIC(CMyButton?CButton)
CMyButton::CMyButton()
{
}
CMyButton::~CMyButton()
{
}
BEGIN_MESSAGE_MAP(CMyButton?CButton)
ON_WM_DRAWITEM()
END_MESSAGE_MAP()
//?CMyButton?消息處理程序
void?CMyButton::DrawItem(LPDRAWITEMSTRUCT?lpDrawItemStruct)
{
//?TODO:??添加您的代碼以繪制指定項
UINT?ustyle?=?DFCS_BUTTONPUSH;
???//?This?code?only?works?with?buttons.
ASSERT(lpDrawItemStruct->CtlType?==?ODT_BUTTON);
//?If?drawing?selected?add?the?pushed?style?to?DrawframeControl.
if?(lpDrawItemStruct->itemState?&?ODS_SELECTED)
ustyle?|=?DFCS_PUSHED;
//?Draw?the?button?frame.
::DrawframeControl(lpDrawItemStruct->hDC?&lpDrawItemStruct->rcItem?
DFC_BUTTON?ustyle);
//?Get?the?button‘s?text.
CString?strText;
GetWindowText(strText);
//?Draw?the?button?text?using?the?text?color?red.
COLORREF?crOldColor?=?::SetTextColor(lpDrawItemStruct->hDC?RGB(25500));
::DrawText(lpDrawItemStruct->hDC?strText?strText.GetLength()?
&lpDrawItemStruct->rcItem?DT_SINGLELINE|DT_VCENTER|DT_CENTER);
::SetTextColor(lpDrawItemStruct->hDC?crOldColor);
}
void?CMyButton::OnDrawItem(int?nIDCtl?LPDRAWITEMSTRUCT?lpDrawItemStruct)
{
//?TODO:?在此添加消息處理程序代碼和/或調用默認值
CButton::OnDrawItem(nIDCtl?lpDrawItemStruct);
}
void?CMyButton::SetResID(UINT?BitID)
{
ResID?=?BitID;
}
void?CMyButton::DrawBK(CDC?*pDC?UINT?ResID)
{
????CDC?memDC;
????memDC.CreateCompatibleDC(pDC);
????CBitmap?bitmap;
????BITMAP?bitStruct;
????bitmap.LoadBitmap(ResID);
????bitmap.GetBitmap(&bitStruct);
????memDC.Selectobject(&bitmap);
????CRect?rect;????????//聲明區域對象
????GetClientRect(rect);????//獲得編輯框客戶區域
????pDC->StretchBlt(44rect.Width()-8rect.Height()-8&memDC00bitStruct.bmWidth
????????bitStruct.bmHeightSRCCOPY);
????memDC.DeleteDC();
????bitmap.Deleteobject();
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????39042??2012-05-24?15:10??MyNewPla
?????文件??????87336??2012-05-24?15:10??MyNewPla
?????文件??????26102??2012-05-24?15:10??MyNewPla
?????文件??????????2??2012-05-24?15:10??MyNewPla
?????文件??????????2??2012-05-24?15:10??MyNewPla
?????文件??????????2??2012-05-24?15:10??MyNewPla
?????文件??????????2??2012-05-24?15:10??MyNewPla
?????文件??????????2??2012-05-24?15:10??MyNewPla
?????文件??????????2??2012-05-24?15:10??MyNewPla
?????文件??????11226??2012-05-24?15:10??MyNewPla
?????文件??????20816??2012-05-24?15:10??MyNewPla
?????文件???????8244??2012-05-24?15:10??MyNewPla
?????文件???????1532??2012-06-03?11:18??MyNewPla
?????文件???????1454??2012-06-03?11:18??MyNewPla
?????文件????????490??2012-06-03?11:18??MyNewPla
?????文件??????27760??2012-05-15?18:45??MyNewPla
?????文件?????765440??2012-05-24?15:10??MyNewPla
?????文件????????667??2012-05-15?14:55??MyNewPla
?????文件????????732??2012-05-15?18:45??MyNewPla
?????文件????????381??2012-05-24?15:10??MyNewPla
?????文件????1456080??2012-05-24?15:10??MyNewPla
?????文件?????????86??2012-06-03?11:18??MyNewPla
?????文件???????1302??2012-06-03?11:18??MyNewPla
?????文件??????34188??2012-05-24?15:10??MyNewPla
?????文件???20381696??2012-05-15?18:45??MyNewPla
?????文件????4303872??2012-05-24?15:10??MyNewPla
?????文件?????503784??2012-05-24?15:00??MyNewPla
?????文件?????126641??2012-05-24?15:10??MyNewPla
?????文件????????218??2012-05-15?14:55??MyNewPla
?????文件??????18984??2012-05-15?18:45??MyNewPla
............此處省略143個文件信息
- 上一篇:MFC 實時曲線繪制
- 下一篇:頭發檢測C++代碼
評論
共有 條評論