⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 errorlog.cpp

📁 一个pmfix程序
💻 CPP
字号:
// ErrorLog.cpp : implementation file
//

#include "stdafx.h"
#include "win32.h"
#include "ErrorLog.h"
#include "pmfix.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CErrorLog dialog


CErrorLog::CErrorLog(CWnd* pParent /*=NULL*/)
	: CDialog(CErrorLog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CErrorLog)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CErrorLog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CErrorLog)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CErrorLog, CDialog)
	//{{AFX_MSG_MAP(CErrorLog)
	ON_BN_CLICKED(IDC_BUTTON_COPY, OnButtonCopy)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CErrorLog message handlers

BOOL CErrorLog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	//Set log text
	GetDlgItem(IDC_EDIT_ERRORLOG)->SetWindowText
			(
				((CPmfix*) GetParent())->log
			);

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}




void CErrorLog::ClipboardSetText(const char *text, UINT format)
{
	// Open clipboard
    OpenClipboard();

	EmptyClipboard();
    
    // Setup a memory HANDLE for the clipboard
	HANDLE hMem = GlobalAlloc( GMEM_FIXED, (strlen(text)+1)*sizeof(char));
    char* pStr = (char*)GlobalLock( hMem );
    strcpy( pStr, text );
    GlobalUnlock( hMem );

    // Tell Clipboard to use our handle now.
    ::SetClipboardData( format, hMem );

	CloseClipboard();
}

void CErrorLog::OnButtonCopy() 
{
	ClipboardSetText(((CPmfix*) GetParent())->log, CF_TEXT);
}

⌨️ 快捷键说明

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