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

📄 transstaticdlg.cpp

📁 透明Static
💻 CPP
字号:
// TransStaticDlg.cpp : implementation file
//

#include "stdafx.h"
#include "TransStatic.h"
#include "TransStaticDlg.h"
#include "DIBSectionCE.h"

CDIBSectionCE m_BKSection;

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

/////////////////////////////////////////////////////////////////////////////
// CTransStaticDlg dialog

CTransStaticDlg::CTransStaticDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CTransStaticDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTransStaticDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	newstatic=new CTransStatic;
}

void CTransStaticDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTransStaticDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CTransStaticDlg, CDialog)
	//{{AFX_MSG_MAP(CTransStaticDlg)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTransStaticDlg message handlers

BOOL CTransStaticDlg::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
	RECT TitleRect;
	TitleRect.left=0;
	TitleRect.top=0;
	TitleRect.right=76;
	TitleRect.bottom=24;

	newstatic->Create(_T("ok"),WS_CHILD |WS_VISIBLE |SS_CENTER, 
			TitleRect,this,4444);
//	newstatic->PaintBG()
	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}



void CTransStaticDlg::OnPaint() 
{
	m_BKSection.Load(_T("\\UI\\DefaultTheme\\desk.bmp"));
	CPaintDC dc(this); // device context for painting

	CDC   *pMemDC;
	pMemDC=new   CDC; 
    pMemDC->CreateCompatibleDC(&dc); 
	pMemDC->SelectObject(m_BKSection.GetSafeHandle());
	m_BKSection.Draw(pMemDC,(0,0));
	dc.StretchBlt(0,0,240,320,pMemDC,0,0,240,320,SRCCOPY);  
	delete   pMemDC;
	// TODO: Add your message handler code here
	
	// Do not call CDialog::OnPaint() for painting messages
}

⌨️ 快捷键说明

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