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

📄 conworking.cpp

📁 一個顯示訊息視窗的Cla
💻 CPP
字号:
// OnWorking.cpp : implementation file
//

#include "stdafx.h"
#include "COnWorking.h"

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

/////////////////////////////////////////////////////////////////////////////
// COnWorking dialog

COnWorking::COnWorking(CWnd* pParent /*=NULL*/)
	: CDialog()
{
	//{{AFX_DATA_INIT(COnWorking)
	//}}AFX_DATA_INIT

	BYTE		DlgTempl[]={
		0xC0, 0x00, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x00,
		0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x00, 0x6F, 0x00, 0x72, 0x00, 0x6B, 0x00, 0x69, 0x00,
		0x6E, 0x00, 0x67, 0x00, 0x2E, 0x00, 0x2E, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x08, 0x00, 0x4D, 0x00,
		0x53, 0x00, 0x20, 0x00, 0x53, 0x00, 0x61, 0x00, 0x6E, 0x00, 0x73, 0x00, 0x20, 0x00, 0x53, 0x00,
		0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x50,
		0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x06, 0x00, 0xB0, 0x00, 0x08, 0x00, 0xF7, 0x03, 0xFF, 0xFF,
		0x82, 0x00, 0x00, 0x00, 0x00, 0x00 };

	CreateIndirect(&DlgTempl, NULL);

	//  Remove caption and border
	//SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & (~(WS_CAPTION | WS_BORDER)));
	SetWindowLong(GetActiveWindow()->m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & (~(WS_CAPTION | WS_BORDER)));

	//  Get the coords of the window
    CRect rect;
    GetWindowRect(&rect);
    int w = rect.Width();
    int h = rect.Height();
    
    CRgn rgn1;
    CRgn rgn2;

    //  Create the top ellipse 
    //rgn1.CreateEllipticRgn(1, 1, w, h/2 + 30);
	CreateRectRgn(1, 1, w, h/2);

    //  Create the bottom ellipse 
    //rgn2.CreateEllipticRgn(1, h/2 - 30, w, h);

    //  Combine the two ellipses 
    //CombineRgn(rgn1, rgn1, rgn2, RGN_OR);
    
    //  Set the window region
    SetWindowRgn(static_cast<HRGN>(rgn1.GetSafeHandle()), true);

    // detach the CRgn object from the region, or else the
    // CRgn destructor would close the HRGN handle when rgn
    // goes out of scope
    //rgn1.Detach();
    //rgn2.Detach();

	//CRect xtrect;
	//m_Prompt.GetClientRect(&xtrect);
	//int xw = xtrect.Width();
	//int xh = xtrect.Height();
	//m_Prompt.MoveWindow(0,(h-xh)/2,xw,xh,true);

	m_Prompt.CenterWindow(this);

	
	ShowWindow(SW_SHOW);
	CenterWindow(NULL);
}


void COnWorking::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COnWorking)
	//DDX_Text(pDX, IDC_PROMPT, m_Prompt);
	DDX_Control(pDX, IDC_PROMPT, m_Prompt);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(COnWorking, CDialog)
	//{{AFX_MSG_MAP(COnWorking)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COnWorking message handlers

void COnWorking::SetPrompt(CString NewPrompt)
{
	m_Prompt.SetWindowText(NewPrompt);
	ShowWindow(SW_SHOW);
	UpdateWindow();
	UpdateData(true);
}

⌨️ 快捷键说明

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