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

📄 cexpdlg.cpp

📁 在WINDOWS CE系统上EVC开发的XP按钮的源码
💻 CPP
字号:
// CeXpDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CeXp.h"
#include "CeXpDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CCeXpDlg dialog

CCeXpDlg::CCeXpDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CCeXpDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CCeXpDlg)
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CCeXpDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CCeXpDlg)
	DDX_Control(pDX, IDC_BUTTON5, m_button5);
	DDX_Control(pDX, IDC_BUTTON4, m_button4);
	DDX_Control(pDX, IDC_BUTTON3, m_button3);
	DDX_Control(pDX, IDC_BUTTON2, m_button2);
	DDX_Control(pDX, IDC_BUTTON1, m_button1);
	DDX_Control(pDX, IDC_EDIT1, m_edit1);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CCeXpDlg, CDialog)
	//{{AFX_MSG_MAP(CCeXpDlg)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCeXpDlg message handlers

BOOL CCeXpDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	CenterWindow(GetDesktopWindow());	// center to the hpc screen

	COLORREF	crBtnColor;
	crBtnColor = ::GetSysColor(COLOR_BTNFACE) + RGB(30, 30, 30);
	// Standard button
	m_button5.SetFont(GetFont());
	m_button5.SetIcon(IDI_EOAPP, CSize(8,8));
	m_button5.SetFlat(FALSE);
	// Standard button
	m_button3.SetFont(GetFont());
	m_button3.SetIcon(IDI_ICON_GREEN_POINT, CSize(16, 16));
	m_button3.SetFlat(FALSE);
	// Back button
	m_button2.SetFont(GetFont());
	m_button2.SetIcon(IDI_EOAPP, CSize(16, 16));
	m_button2.SetColor(CCeButtonST::BTNST_COLOR_BK_IN, crBtnColor);
	m_button2.SetColor(CCeButtonST::BTNST_COLOR_FG_IN, RGB(0, 128, 0));
	m_button2.SetRounded(TRUE);
	// Lamp button
	m_button4.SetFont(GetFont());
	m_button4.SetIcon(IDI_LAMP1, CSize(32, 32), IDI_LAMP2, CSize(32, 32));
	m_button2.SetColor(CCeButtonST::BTNST_COLOR_BK_IN, RGB(0, 128, 255));
	m_button4.SetAlign(CCeButtonST::ST_ALIGN_VERT);
	m_button4.DrawBorder(FALSE);
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}



void CCeXpDlg::OnButton1() 
{
    CString str_hex2=_T("");
    CString str_hex1=_T("");
    CString str_type1=_T("州");
    wchar_t wbuf[10];
    unsigned char *temp_temp=new unsigned char[20];
	wcscpy(wbuf,str_type1.GetBuffer(0));
//    MultiByteToWideChar(CP_ACP, 0, str_type1.GetBuffer(0), -1, wbuf, 20);
    int k=0;
    for(int l=0;l<wcslen(wbuf);l++)
    {
        temp_temp[k++]=wbuf[l]/256;
        temp_temp[k++]=wbuf[l];
    }
	for(l=0;l<k;l++)
    {
        str_hex1.Format(_T("%02X "),temp_temp[l]);
        str_hex2+=str_hex1;
    }
    AfxMessageBox(str_hex2);	
}

⌨️ 快捷键说明

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