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

📄 bkwnd.cpp

📁 网络游戏魔域源代码 测试可以完整变异
💻 CPP
字号:
// BkWnd.cpp : implementation file
//

#include "stdafx.h"
#include "myshell.h"
#include "BkWnd.h"

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

/////////////////////////////////////////////////////////////////////////////
// CBkWnd

CBkWnd::CBkWnd()
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

CBkWnd::~CBkWnd()
{
}


BEGIN_MESSAGE_MAP(CBkWnd, CWnd)
	//{{AFX_MSG_MAP(CBkWnd)
	ON_WM_SHOWWINDOW()
	ON_WM_CLOSE()
	ON_WM_ACTIVATEAPP()
	ON_WM_ACTIVATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CBkWnd message handlers

void CBkWnd::Create()
{
	CRect rect = CRect( 0, 0, 1024, 768 ) ;
	CreateEx( NULL,  
			  AfxRegisterWndClass(0,AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
			  "MyWnd",
			  WS_POPUP,
			  rect,
			  NULL,
			  NULL,
			  NULL);
}

void CBkWnd::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CWnd::OnShowWindow(bShow, nStatus);
	
	m_MyShellDlg.Create( IDD_MYSHELL_DIALOG, this ) ;
	if ( m_MyShellDlg.m_hWnd && m_MyShellDlg.m_bInitSuc )
	{
		m_MyShellDlg.ShowWindow( SW_SHOW ) ;
		m_MyShellDlg.SetWindowPos(&m_MyShellDlg.wndTop,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
		m_MyShellDlg.SetFocus() ;
	}

	SetIcon(m_hIcon, TRUE);	
	SetIcon(m_hIcon, FALSE);
}
void CBkWnd::OnClose()
{
	m_MyShellDlg.RealExit();
	CWnd::OnClose();
}

void CBkWnd::OnActivateApp(BOOL bActive, HTASK hTask) 
{
	CWnd::OnActivateApp(bActive, hTask);
//	if (!bActive ) 
//	{
//		this->m_MyShellDlg.PostMessage (WM_MY_MESSAGE, ON_MIN);
//	}

	// TODO: Add your message handler code here
}

void CBkWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) 
{
	CWnd::OnActivate(nState, pWndOther, bMinimized);
	
	// TODO: Add your message handler code here
	if(nState == WA_INACTIVE && !bMinimized )
	{
		m_MyShellDlg.SetWindowPos(&m_MyShellDlg.wndNoTopMost,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
	}
	else if ( (nState == WA_ACTIVE || nState == WA_CLICKACTIVE)
				&& !bMinimized) 
	{
		m_MyShellDlg.SetWindowPos(&m_MyShellDlg.wndTopMost,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
	}
}

⌨️ 快捷键说明

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