www.pudn.com > ScrSnapSrc4.0.zip > ScreenSnapDlg.h


////////////////////////////////////////////////////////////////////////////// 
//类名:CScreenSnapDlg 
//功能:轻松抓图实现对话框 
//作者:徐景周(jingzhou_xu@163.net) 
//组织:未来工作室(Future Studio) 
//日期:2001.12.1 
///////////////////////////////////////////////////////////////////////////// 
#if !defined(AFX_SCREENSNAPDLG_H__D4665716_115D_40D9_8A39_60777EA17013__INCLUDED_) 
#define AFX_SCREENSNAPDLG_H__D4665716_115D_40D9_8A39_60777EA17013__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
 
///////////////////////////////////////////////////////////////////////////// 
// CScreenSnapDlg dialog 
#include "WBButton.h"		//加入位图按钮类 
#include "HyperLink.h"		//加入超链接类 
#include "PictureEx.h"		//加入GIF动态图像显示 
#include "NTray.h"			//加入系统托盘支持头文件 
 
class CScreenSnapDlg : public CDialog 
{ 
// Construction 
public: 
	CScreenSnapDlg(CWnd* pParent = NULL);							  // standard constructor 
 
	 
// Dialog Data 
	//{{AFX_DATA(CScreenSnapDlg) 
	enum { IDD = IDD_SCREENSNAP_DIALOG }; 
	CStatic	m_Description; 
	CWBButton	m_Save; 
	CWBButton	m_Hide; 
	CWBButton	m_Exit; 
	CWBButton	m_Snap; 
	CWBButton	m_About; 
	CString		m_Usage; 
	//}}AFX_DATA 
 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CScreenSnapDlg) 
	public: 
	virtual BOOL DestroyWindow(); 
	protected: 
	virtual void DoDataExchange(CDataExchange* pDX);					// DDX/DDV support 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
	HICON			m_hIcon;											//系统托盘支持设置变量 
	CTrayNotifyIcon m_TrayIcon; 
 
	HWND m_hwndFoundWindow;                                             //选中图像窗体的句柄 
	BOOL m_bStartSnapWindow;											//是否开始抓取图像窗体操作 
 
	//窗体显示/隐藏的动画效果   
	void WinAnimation(BOOL ShowFlag);									 
 
	//将选中图像复制到系统剪切板中 
	void toClipboard(CWnd * wnd, BOOL FullWnd); 
	void toClipboard_Bio(CWnd * wnd, BOOL FullWnd); 
	BOOL CaptureWindowToClipboard (HWND hwndToCapture); 
 
	//位图转换(DDB转DIB) 
	HANDLE DDBToDIB( CBitmap& bitmap, DWORD dwCompression = BI_RGB);  
	 
	//刷新及高亮显示选中的窗体图像 
	long RefreshWindow(HWND hwndWindow); 
	long HighlightFoundWindow(HWND hwndFoundWindow); 
 
	//检验窗口的有效性 
	BOOL CheckWindowValidity(HWND hwndToCheck); 
 
	//保存为位图文件 
	BOOL SaveBitmapToFile(HBITMAP hBitmap , CString lpFileName); 
 
	// Generated message map functions 
	//{{AFX_MSG(CScreenSnapDlg) 
	afx_msg LRESULT OnTrayNotification(WPARAM wParam, LPARAM lParam);  //自定义系统拖盘消息 
	afx_msg LRESULT OnHotKey(WPARAM wParam, LPARAM lParam);			   //自定义系统热键 
	virtual BOOL OnInitDialog(); 
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 
	afx_msg void OnPaint(); 
	afx_msg HCURSOR OnQueryDragIcon(); 
	afx_msg void OnScreensnap(); 
	afx_msg void OnAbout(); 
	afx_msg void OnShowhide(); 
	afx_msg void OnExit(); 
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point); 
	afx_msg void OnTimer(UINT nIDEvent); 
	afx_msg void OnHideWindow(); 
	afx_msg void OnSnapWindow(); 
	afx_msg void OnSavebmp(); 
	afx_msg void OnSaveBmp(); 
	//}}AFX_MSG 
	DECLARE_MESSAGE_MAP() 
}; 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_SCREENSNAPDLG_H__D4665716_115D_40D9_8A39_60777EA17013__INCLUDED_)