ProcessBDlg.cpp
上传用户:xinsanhua
上传日期:2022-05-17
资源大小:80k
文件大小:5k
- // ProcessBDlg.cpp : 备泅 颇老
- //
- #include "stdafx.h"
- #include "ProcessB.h"
- #include "ProcessBDlg.h"
- #include ".processbdlg.h"
- #include "BookInfo.h"
- #include "Protocol.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #endif
- // 览侩 橇肺弊伐 沥焊俊 荤侩登绰 CAboutDlg 措拳 惑磊涝聪促.
- class CAboutDlg : public CDialog
- {
- public:
- CAboutDlg();
- // 措拳 惑磊 单捞磐
- enum { IDD = IDD_ABOUTBOX };
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 瘤盔
- // 备泅
- protected:
- DECLARE_MESSAGE_MAP()
- };
- CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
- {
- }
- void CAboutDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- }
- BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
- END_MESSAGE_MAP()
- // CProcessBDlg 措拳 惑磊
- CProcessBDlg::CProcessBDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CProcessBDlg::IDD, pParent)
- {
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- }
- void CProcessBDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- }
- BEGIN_MESSAGE_MAP(CProcessBDlg, CDialog)
- ON_WM_SYSCOMMAND()
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- //}}AFX_MSG_MAP
- // ON_WM_COPYDATA()
- ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
- END_MESSAGE_MAP()
- // CProcessBDlg 皋矫瘤 贸府扁
- BOOL CProcessBDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // 矫胶袍 皋春俊 "沥焊..." 皋春 亲格阑 眠啊钦聪促.
- // IDM_ABOUTBOX绰 矫胶袍 疙飞 裹困俊 乐绢具 钦聪促.
- ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
- ASSERT(IDM_ABOUTBOX < 0xF000);
- CMenu* pSysMenu = GetSystemMenu(FALSE);
- if (pSysMenu != NULL)
- {
- CString strAboutMenu;
- strAboutMenu.LoadString(IDS_ABOUTBOX);
- if (!strAboutMenu.IsEmpty())
- {
- pSysMenu->AppendMenu(MF_SEPARATOR);
- pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
- }
- }
- // 捞 措拳 惑磊狼 酒捞能阑 汲沥钦聪促. 览侩 橇肺弊伐狼 林 芒捞 措拳 惑磊啊 酒匆 版快俊绰
- // 橇饭烙况农啊 捞 累诀阑 磊悼栏肺 荐青钦聪促.
- SetIcon(m_hIcon, TRUE); // 奴 酒捞能阑 汲沥钦聪促.
- SetIcon(m_hIcon, FALSE); // 累篮 酒捞能阑 汲沥钦聪促.
- // TODO: 咯扁俊 眠啊 檬扁拳 累诀阑 眠啊钦聪促.
-
- return TRUE; // 牧飘费俊 措茄 器目胶甫 汲沥窍瘤 臼阑 版快 TRUE甫 馆券钦聪促.
- }
- void CProcessBDlg::OnSysCommand(UINT nID, LPARAM lParam)
- {
- if ((nID & 0xFFF0) == IDM_ABOUTBOX)
- {
- CAboutDlg dlgAbout;
- dlgAbout.DoModal();
- }
- else
- {
- CDialog::OnSysCommand(nID, lParam);
- }
- }
- // 措拳 惑磊俊 弥家拳 窜眠甫 眠啊且 版快 酒捞能阑 弊府妨搁
- // 酒贰 内靛啊 鞘夸钦聪促. 巩辑/轰 葛胆阑 荤侩窍绰 MFC 览侩 橇肺弊伐狼 版快俊绰
- // 橇饭烙况农俊辑 捞 累诀阑 磊悼栏肺 荐青钦聪促.
- void CProcessBDlg::OnPaint()
- {
- if (IsIconic())
- {
- CPaintDC dc(this); // 弊府扁甫 困茄 叼官捞胶 牧咆胶飘
- SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
- // 努扼捞攫飘 荤阿屈俊辑 酒捞能阑 啊款单俊 嘎娩聪促.
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
- // 酒捞能阑 弊赋聪促.
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
- }
- // 荤侩磊啊 弥家拳等 芒阑 掺绰 悼救俊 目辑啊 钎矫登档废 矫胶袍俊辑
- // 捞 窃荐甫 龋免钦聪促.
- HCURSOR CProcessBDlg::OnQueryDragIcon()
- {
- return static_cast<HCURSOR>(m_hIcon);
- }
- BOOL CProcessBDlg::PreTranslateMessage(MSG* pMsg)
- {
- // TODO: Add your specialized code here and/or call the base class
- switch(pMsg->message)
- {
- case WM_KEYDOWN:
- {
- switch(pMsg->wParam)
- {
- case VK_ESCAPE:
- case VK_RETURN:
- return TRUE;
- }
- }
- }
- return CDialog::PreTranslateMessage(pMsg);
- }
- LRESULT CProcessBDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
- {
- // TODO: Add your specialized code here and/or call the base class
- switch(message)
- {
- case WM_COPYDATA:
- {
- PCOPYDATASTRUCT pcds = (PCOPYDATASTRUCT) lParam;
- //
- // 橇肺配妮俊 蝶弗 贸府甫 困秦辑 ..
- //
- switch(pcds->dwData)
- {
- case Protocol::PROTOCOL_BOOKINFO:
- {
- //
- // 傈价罐篮 单捞磐(COPYDATASTRUCT 备炼眉)甫 钱绢辑 BookInfo俊 悸泼钦聪促.
- //
- BookInfo bookInfo;
- bookInfo.m_nID = ((BookInfo*)pcds->lpData)->m_nID;
- _tcsncpy(bookInfo.m_szName, ((BookInfo*)pcds->lpData)->m_szName, pcds->cbData - sizeof(int));
- //
- // 傈价罐篮 单捞磐甫 皋矫瘤 冠胶甫 免仿钦聪促.
- //
- CString strReceiveMsg;
- strReceiveMsg.Format(_T("ID : %dtName : %s"), bookInfo.m_nID, bookInfo.m_szName);
- AfxMessageBox(strReceiveMsg);
- //
- // wParam栏肺 甸绢 柯 扩档快 勤甸阑 捞侩秦辑 单捞磐甫 傈价茄 橇肺技胶俊霸 单捞磐甫 俊内钦聪促.
- //
- HWND hWnd = (HWND) wParam;
- ::SendMessage(hWnd, WM_COPYDATA, 0, (LPARAM) pcds);
- break;
- }
- case Protocol::PROTOCOL_COOKINFO:
- {
- // Do something ..
- break;
- }
- }
- }
- }
- return CDialog::WindowProc(message, wParam, lParam);
- }
- void CProcessBDlg::OnBnClickedButton1()
- {
- // TODO: Add your control notification handler code here
- }