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

📄 senderview.cpp

📁 Visual C++程序设计技巧与实例
💻 CPP
字号:
// SenderView.cpp : implementation of the CSenderView class
//

#include "stdafx.h"
#include "Sender.h"

#include "SenderDoc.h"
#include "SenderView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSenderView

IMPLEMENT_DYNCREATE(CSenderView, CView)

BEGIN_MESSAGE_MAP(CSenderView, CView)
	//{{AFX_MSG_MAP(CSenderView)
	ON_COMMAND(ID_EDIT_UNBLOCKMESSAGE, OnEditUnblockmessage)
	ON_COMMAND(ID_EDIT_BLOCKMESSAGE, OnEditBlockmessage)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSenderView construction/destruction

CSenderView::CSenderView()
{
	// TODO: add construction code here

}

CSenderView::~CSenderView()
{
}

BOOL CSenderView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CSenderView drawing

void CSenderView::OnDraw(CDC* pDC)
{
	CSenderDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CSenderView printing

BOOL CSenderView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CSenderView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CSenderView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CSenderView diagnostics

#ifdef _DEBUG
void CSenderView::AssertValid() const
{
	CView::AssertValid();
}

void CSenderView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CSenderDoc* CSenderView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSenderDoc)));
	return (CSenderDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSenderView message handlers

void CSenderView::OnEditUnblockmessage() 
{
	// TODO: Add your command handler code here
	CString str="Receiver"; 
	CWnd *pWnd=CWnd::FindWindow(NULL,str); 
	if(pWnd != NULL) 
	{
		pWnd->PostMessage(WM_MYMESSAGE, 0, 1); 
	}
}

void CSenderView::OnEditBlockmessage() 
{
	// TODO: Add your command handler code here
	CString str = "Receiver";
	CWnd *pWnd = CWnd::FindWindow(NULL, str);
	if (pWnd != NULL)
	{
		pWnd->SendMessage(WM_MYMESSAGE, 1, 0);
	}
}

⌨️ 快捷键说明

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