previewdlg.h

来自「这是一个学生信息管理系统」· C头文件 代码 · 共 72 行

H
72
字号
#pragma once //这些代码由王昌栋编写,未经允许,不得随便改动,如有问题欢迎提出!


// CPreviewDlg 对话框
#if defined (WIN32)
    #define IS_WIN32 TRUE
#else
    #define IS_WIN32 FALSE
#endif

#define MAX_DEBUG_STRING    256
#define IS_NT      (0 != (IS_WIN32 && ((BOOL)(GetVersion() < 0x80000000))) )
#define IS_WIN32S  (0 != (IS_WIN32 && (BOOL)(!(IS_NT) && (LOBYTE(LOWORD(GetVersion()))<4))))
#define IS_WIN95   (0 != ((BOOL)(!(IS_NT) && !(IS_WIN32S)) && IS_WIN32))

class CPreviewDlg : public CDialog
{
	DECLARE_DYNAMIC(CPreviewDlg)

public:
	CPreviewDlg(CWnd* pParent = NULL);   // 标准构造函数
	virtual ~CPreviewDlg();
	void SetCallBackFun(PRINTPREVIEW pFun, PRNINFO sPrnInfo);
	void PrintDoc();
	void SetCurrentPage(int, int);
// 对话框数据
	enum { IDD = IDD_PREVIEW_DLG };

	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	//}}AFX_VIRTUAL

// Implementation
protected:
	PRINTPREVIEW	pDrawInfo;
	PRNINFO			PrnInfo;

	CBitmap		cBmp;
	CBrush		m_brush;
	CPen		cPen;
	int			nW, nH;
	CRect		WndRect;
	int			m_CountPage;	//共多少页
	int			m_CurPage;		//当前页

    SCROLLINFO  si;	
	int			iDeltaPerLine, iAccumDelta, xPt, yPt;


	void	SetScrollbar(int cx, int cy);
	HDC		GetPrinterDC(LPTSTR lpszFriendlyName, PDEVMODE pDevMode);
	LPTSTR	GetDefaultPrinterName(void);
	LPTSTR	GetRegistryString(HKEY hKeyClass, LPTSTR lpszSubKey, LPTSTR lpszValueName);
	LPTSTR	CopyString(LPTSTR  lpszSrc);
	PDEVMODE GetDefaultPrinterDevMode(LPTSTR lpszPrinterName);
	void	DebugMsg (LPTSTR lpszMessage,...);
	HDC		GetDefaultPrinterDC();

	// Generated message map functions
	//{{AFX_MSG(CPreView)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	DECLARE_MESSAGE_MAP()
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?