DragWnd.h
资源名称:GGBT.rar [点击查看]
上传用户:lds876
上传日期:2013-05-25
资源大小:567k
文件大小:3k
源码类别:
P2P编程
开发平台:
Visual C++
- #if !defined(AFX_DRAGWND_H__FDED5A98_767D_47CB_BE10_D7C601B3A76C__INCLUDED_)
- #define AFX_DRAGWND_H__FDED5A98_767D_47CB_BE10_D7C601B3A76C__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // DragWnd.h : header file
- //
- #include "CategoryDownload.h"
- #include "MonitorSpeedbase.h"
- //
- // onMessage(long lParam, long wParam)
- // lParam will be WM_LBUTTONDBLCLK or WM_CONTEXTMENU. wParam be NULL.
- //
- #define WM_DRAGWND_NOTIFY WM_USER + 3121
- typedef BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND hWnd,COLORREF crKey,
- BYTE bAlpha, // value for the blend function
- DWORD dwFlags // action
- );
- /////////////////////////////////////////////////////////////////////////////
- // CDragWnd window
- class CDragWnd : public CMonitorSpeedbase
- {
- // Construction
- public:
- CDragWnd();
- // Attributes
- public:
- // Operations
- public:
- BOOL CreateExtend(CWnd* pMainFrame, CCategoryDownload* pCategoryDownload);
- void SetStandardSize();
- int GetOpacity();
- BOOL SetOpacity(int nOpacity=220);
- void SetTransparent(BOOL bTransparent=true);
- BOOL SetTransparentEx(BOOL bTransparent=true, int nOpactiy=220);
- void ShowText(bool bShowText);
- bool IsShowText();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CDragWnd)
- public:
- virtual BOOL DestroyWindow();
- //}}AFX_VIRTUAL
- // Implementation
- public:
- bool CanSetTransparent();
- virtual ~CDragWnd();
- // Generated message map functions
- protected:
- //{{AFX_MSG(CDragWnd)
- afx_msg void OnPaint();
- afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
- afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnNcPaint();
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- //}}AFX_MSG
- afx_msg void OnGetMinMaxInfo( MINMAXINFO FAR* lpMMI );
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg UINT OnNcHitTest(CPoint point);
- afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
- afx_msg void OnTimer(UINT nIDEvent);
- DECLARE_MESSAGE_MAP()
- private:
- void LoadState();
- void SaveState();
- BOOL GetEdgeRect(CRect rcWnd, UINT nHitTest, CRect& rcEdge);
- UINT GetEdgeHTCode(int nEdge);
- bool m_bShowText;
- int m_nOpacity;
- BOOL m_bTransparent;
- CWnd* m_pMainFrame;
- CCategoryDownload* m_pCategoryDownload;
- CFont m_font;
- const CPoint m_defSize;
- int m_iEdge;
- static const CString m_strSection;
- pSetLayeredWindowAttributes SetLayeredWindowAttributes;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_DRAGWND_H__FDED5A98_767D_47CB_BE10_D7C601B3A76C__INCLUDED_)