mystatic.cpp

来自「用vb实现在线考试系统」· C++ 代码 · 共 81 行

CPP
81
字号
// MyStatic.cpp : implementation file
//

#include "stdafx.h"
#include "Cli_SoftAndHard.h"
#include "MyStatic.h"

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

extern LPSHOWPARAMS ShowParams;
extern int iCurrentWin;
extern void mySendMessage(int iMessage, char* strMessage);
extern int gShowMode;
/////////////////////////////////////////////////////////////////////////////
// CMyStatic

CMyStatic::CMyStatic()
{
}

CMyStatic::~CMyStatic()
{
}


BEGIN_MESSAGE_MAP(CMyStatic, CStatic)
	//{{AFX_MSG_MAP(CMyStatic)
	ON_WM_CONTEXTMENU()
	ON_WM_LBUTTONDBLCLK()
	ON_COMMAND(IDC_SELECT, OnSelect)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMyStatic message handlers

void CMyStatic::OnContextMenu(CWnd* pWnd, CPoint point) 
{
	// TODO: Add your message handler code here
	CMenu menu;
	menu.LoadMenu(IDR_MENU1);
	CMenu* pContextMenu=menu.GetSubMenu(0);
	pContextMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x,point.y,pWnd);
}

void CMyStatic::OnLButtonDblClk(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	char strMessage[50];

	if(gShowMode == VIDEO_MULTI_MODE)
	{
		gShowMode = VIDEO_SINGLE_MODE;
		sprintf(strMessage, "SINGLE$%d", iCurrentWin+1);
		mySendMessage(WM_MYSINGLEMODE, strMessage);
	}
	else
	{
		gShowMode = VIDEO_MULTI_MODE;
		sprintf(strMessage, "MULTI$%d", iCurrentWin+1);
		mySendMessage(WM_MYMULTIMODE, strMessage);
	}


	//SendMessage(this->m_hWnd, WM_MYDBLCLICK, 0, 0);

	CStatic::OnLButtonDblClk(nFlags, point);
}

void CMyStatic::OnSelect() 
{
	// TODO: Add your command handler code here
	char strMessage[50];
	sprintf(strMessage, "SELECT$%d", rand());
	mySendMessage(WM_MYMULTIMODE, strMessage);
}

⌨️ 快捷键说明

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