www.pudn.com > MCIWnd_MediaPlayer.rar > MyPlayer.h


#pragma once 
 
#define WM_CHANGEPOS WM_USER+100 
#define WM_FINISH WM_USER+101 
#define WM_NEXT WM_USER+102 
// CMyPlayer 
LRESULT CALLBACK AFX_EXPORT 
RygWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam); 
enum PlayState{Playing,Stopped,Pausing}; 
struct MCIState{ 
LONG total; 
LONG cur; 
PlayState ps; 
CString Message; 
int type;//0 video 1 audio 2 graph 
int order;//0 ˳Ðò 1 Ëæ¼´ 2 ÖØ¸´ 
}; 
class CMyPlayer : public CWnd 
{ 
	DECLARE_DYNAMIC(CMyPlayer) 
 
public: 
	CMyPlayer(); 
	virtual ~CMyPlayer(); 
 
protected: 
	DECLARE_MESSAGE_MAP() 
public: 
	MCIState state; 
//	afx_msg void OnPaint(); 
	static BOOL RegisterWndClass(HINSTANCE hInstancea); 
	CWnd* m_parent; 
	void Max(); 
	BOOL Play(CString file); 
	HWND mciWnd; 
	LRESULT OnNotifyPos(WPARAM wParam, LPARAM lParam); 
	LRESULT OnNotifyMode(WPARAM wParam, LPARAM lParam); 
	afx_msg void OnPaint(); 
	BOOL PlayFromState(void); 
	BOOL Stop(void); 
	BOOL Pause(void); 
	BOOL MoveWindow(int x,int y,int nWidth,int nHeight,BOOL bRepaint = TRUE); 
	BOOL MoveWindow(LPCRECT lpRect,BOOL bRepaint = TRUE);  
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/); 
	LONG GetVolume(void); 
	BOOL SetVolumn(long vol); 
	CRect GetSource(void); 
	bool KeepRate; 
	void ModifyWindow(void); 
	void ShowPic(CDC* pDC); 
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point); 
	BOOL PlayNew(CString file); 
};