亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? formctrl.cpp

?? Visual C++實踐與提高-劉刀桂, 孟繁晶編著
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*****************************************************************************
  File: FormControl.cpp

  Purpose:
     Implement the CFormControl class from which the Form OLE Controls can be
	 derived. The primary purpose of this class is to create the controls
	 window using CWnd::CreateDlg. Also provided is a default design time
	 representation of the control, a means of forcing the control to the 
	 size of the dialog template, and code to handle mouse and keyboard
	 processing.

  Includes:
     #include "FormControl.h"
     #include "Wnd2.h"
     #include "AfxPriv.h"
     #include "AfxImpl.h"
     #include "CtlImpl.h"
     #include "OccImpl.h"

  Functions:
     CFormControl        - Initialize member variables and calculate the dialog
	                       template size.
     OnSetExtent         - Sets the size of the control.
     OnInitialUpdate     - Handles the child control initialization.
     OnDraw              - Provides a border at design time.
     PreTranslateMessage - If m_hWnd is valid, allows IsDialogMessage to 
	                       to try and handle the message.
     OnActivateControl   - Handler to be executed when a child window gets the
	                       focus.
     OnSetFocus          - Handles the case when tabbing into the OLE Form Control.
     CreateControlWindow - Creates m_hWnd using CWnd::CreateDlg

     SetOccDialogInfo    - Copied from CFormView.
     HandleInitDialog    - Copied from CFormView

     GetClassID          - Had to override COleControl pure virtual function.
     GetUserTypeNameID   - Had to override COleControl pure virtual function.
     GetMiscStatus       - Had to override COleControl pure virtual function.
     
     OnMouseActivate     - To make the OLE control layer transparent mouse 
     OnMouseMove         - messages should come through the child controls. 
     OnLButtonDblClk     - These functions have empty implementations so as 
     OnLButtonDown       - to turn off the default mouse message processing 
     OnLButtonUp         - of an OLE control.
     OnMButtonDblClk     - See Above.
     OnMButtonDown       - See Above.
     OnMButtonUp         - See Above.
     OnRButtonDblClk     - See Above.
     OnRButtonDown       - See Above.
     OnRButtonUp         - See Above.

  Other:
     _AfxCheckDialogTemplate - Global helper function copied from CFormView.

  Development Team: ShawnK

  Written by Microsoft Product Support Services, Languages Developer Support
  Copyright (c) 1993 Microsoft Corporation. All rights reserved.
\****************************************************************************/


#include "stdafx.h"
#include "FormCtrl.h"
#include "AfxPriv.h"
#include "AfxImpl.h"
#include "CtlImpl.h"
#include "OccImpl.h"

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

IMPLEMENT_DYNCREATE(CFormControl, COleControl)

//**************************************************************************
// Initialize member variables and calculate the dialog template size.
CFormControl::CFormControl(LPCTSTR lpszTemplateName, BOOL bAutoSize):
	m_bAutoSize(bAutoSize),
	m_lpszTemplateName(lpszTemplateName),
	m_hWndCurrentChild(NULL),
	m_cTemplateSize(0,0),
	m_sFormName("Form Control")
{
	// load dialog resource
	LPDLGTEMPLATE lpDialogTemplate = NULL;
	HGLOBAL hDialogTemplate = NULL;
	HINSTANCE hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG);
	HRSRC hResource = ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG);
	hDialogTemplate = LoadResource(hInst, hResource);
	if (hDialogTemplate != NULL)
		lpDialogTemplate = (LPDLGTEMPLATE)LockResource(hDialogTemplate);
	ASSERT(lpDialogTemplate != NULL);

	// Get the dialog template size in pixels for OnSetExtent.
	CDialogTemplate cdt_Form(lpDialogTemplate);
	tagSIZE dlgSize;
	cdt_Form.GetSizeInPixels(&dlgSize);
	m_cTemplateSize.cx = dlgSize.cx; 
	m_cTemplateSize.cy = dlgSize.cy; 

	// free dialog resource
	UnlockResource(hDialogTemplate);
	FreeResource(hDialogTemplate);
}

//**************************************************************************
// Initialize member variables and calculate the dialog template size.
CFormControl::CFormControl(UINT nIDTemplate, BOOL bAutoSize):
	m_bAutoSize(bAutoSize),
	m_hWndCurrentChild(NULL),
	m_cTemplateSize(0,0),
	m_sFormName("Form Control")

{
	ASSERT_VALID_IDR(nIDTemplate);
	m_lpszTemplateName = MAKEINTRESOURCE(nIDTemplate);

	// load dialog resource
	LPDLGTEMPLATE lpDialogTemplate = NULL;
	HGLOBAL hDialogTemplate = NULL;
	HINSTANCE hInst = AfxGetInstanceHandle();
	HRSRC hResource = ::FindResource(hInst, m_lpszTemplateName, RT_DIALOG);
	hDialogTemplate = LoadResource(hInst, hResource);
	if (hDialogTemplate != NULL)
		lpDialogTemplate = (LPDLGTEMPLATE)LockResource(hDialogTemplate);
	ASSERT(lpDialogTemplate != NULL);
	
	// Get the dialog template size in pixels for OnSetExtent.
	CDialogTemplate cdt_Form(lpDialogTemplate);
	tagSIZE dlgSize;
	cdt_Form.GetSizeInPixels(&dlgSize);
	m_cTemplateSize.cx = dlgSize.cx; 
	m_cTemplateSize.cy = dlgSize.cy; 

	// free dialog resource
	UnlockResource(hDialogTemplate);
	FreeResource(hDialogTemplate);
}

//**************************************************************************
CFormControl::~CFormControl()
{
}

//**************************************************************************
// Set the size of the control to the size of the dialog template it was 
// created from. This functionality can be turned off.
BOOL CFormControl::OnSetExtent( LPSIZEL lpSizeL )
{
	if (m_bAutoSize) {
	    // This function limits the height of a control to
		// to the size of the dialog template

	    // Use the desktop window to get a DC so we can use
		// CDC::HIMETRICtoDP and CDC::DPtoHIMETRIC
	    CWnd *pWnd = CWnd::FromHandle(::GetDesktopWindow());
		CClientDC dc(pWnd);

	    CSize sz(m_cTemplateSize.cx,m_cTemplateSize.cy);
		dc.DPtoHIMETRIC(&sz);//re-convert to HIMETRIC
		lpSizeL->cx = sz.cx;
		lpSizeL->cy = sz.cy;
	}
		
	return COleControl::OnSetExtent(lpSizeL);
}

//**************************************************************************
// Modify CreateControlWindow to create m_hWnd using CreateDlg. This will
// create the window using the dialog resource parameter in the constructor.
BOOL CFormControl::CreateControlWindow(HWND hWndParent, const CRect& rcPos,
	LPCRECT prcClipped)
{
	ASSERT(hWndParent != NULL);
	ASSERT(m_lpszTemplateName != NULL);

	// If m_hWnd is NULL then call OnInitialUpdate.
	BOOL bInitialUpdate = (m_hWnd == NULL);

	if (prcClipped == NULL)
		prcClipped = &rcPos;

	if (m_hWnd == NULL)
	{
		// If window doesn't exist, create it.

		// Test if:
		// we're not subclassing a Windows control, or
		// container reflects messages for us...
		// we create normally if:
		//       (we're not subclassing -or- the container reflects)
		// -and- the container autoclips for us
		if ((!IsSubclassedControl() || m_bMsgReflect) && m_bAutoClip)
		{
			// Just create the control's window.
#ifdef _DEBUG
			// dialog template must exist and be invisible with WS_CHILD set
			if (!_AfxCheckDialogTemplate(m_lpszTemplateName, TRUE))
			{
				ASSERT(FALSE);          // invalid dialog template name
				PostNcDestroy();        // cleanup if Create fails too soon
				return FALSE;
			}
#endif //_DEBUG

#ifdef _MAC
			HINSTANCE hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG);
			_AfxStripDialogCaption(hInst, m_lpszTemplateName);
#endif

			// initialize common controls
			if (AfxDeferRegisterClass(AFX_WNDOLECONTROL_REG))
			{
				// create a modeless dialog window.
				CWnd* pParent = CWnd:: FromHandle(hWndParent);

				if (!CreateDlg(m_lpszTemplateName, pParent))
					return FALSE;
				if (m_hWnd != NULL) {
					MoveWindow (rcPos, TRUE);
					::ShowWindow(hWndParent, SW_SHOW);
					::ShowWindow(m_hWnd, SW_SHOW);
					SetFocus();
				}
			}
		}
		else    // ...we're subclassing a Windows control.
		{
			if (m_pReflect == NULL)
			{
				// Create a window to reflect notification messages.
				m_pReflect = new CReflectorWnd;
				if (!m_pReflect->Create(prcClipped, hWndParent))
				{
					// If m_pReflect->Create failed, then m_pReflect deleted itself.
					m_pReflect = NULL;
				}
			}
			else
			{
				// Reflector window already exists... just reparent it.
				if (m_pReflect->m_hWnd != NULL)
				{
					::SetParent(m_pReflect->m_hWnd, hWndParent);
					::SetWindowPos(m_pReflect->m_hWnd, NULL, 0, 0, 0, 0,
						SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|
						SWP_SHOWWINDOW);
				}
			}

			if (m_pReflect != NULL && m_pReflect->m_hWnd != NULL)
			{
#ifdef _DEBUG
				// dialog template must exist and be invisible with WS_CHILD set
				if (!_AfxCheckDialogTemplate(m_lpszTemplateName, TRUE))
				{
					ASSERT(FALSE);          // invalid dialog template name
					PostNcDestroy();        // cleanup if Create fails too soon
					return FALSE;
				}
#endif //_DEBUG

#ifdef _MAC
				HINSTANCE hInst = AfxFindResourceHandle(m_lpszTemplateName, RT_DIALOG);
				_AfxStripDialogCaption(hInst, m_lpszTemplateName);
#endif

				// Create the control's window.
				CreateDlg(m_lpszTemplateName, m_pReflect);
				if (m_hWnd == NULL)
				{
					// Window creation failed: cleanup.
					m_pReflect->DestroyWindow();
					m_pReflect = NULL;
				}else{
					// Make both windows visible.
					m_pReflect->ShowWindow(SW_SHOW);
					MoveWindow (rcPos, TRUE);
					::ShowWindow(m_hWnd, SW_SHOW);
					SetFocus();
				}
			}
		}

		// Set the new window's font.
		OnFontChanged();
	}
	else
	{
		// If window does exist, reparent and reposition it.
		CWnd* pWndOuter = GetOuterWindow();
		ASSERT(pWndOuter != NULL);

		if (::GetParent(pWndOuter->m_hWnd) != hWndParent)
			ReparentControlWindow(pWndOuter->m_hWnd, hWndParent);

		::SetWindowPos(pWndOuter->m_hWnd, NULL, 0, 0, 0, 0,
			SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE|
			SWP_SHOWWINDOW);

		if (m_pReflect == NULL)
			::MoveWindow(m_hWnd, rcPos.left, rcPos.top,
				rcPos.Width(), rcPos.Height(), TRUE);
		else
		{
			pWndOuter->MoveWindow(prcClipped, TRUE);
			::MoveWindow(m_hWnd, m_ptOffset.x, m_ptOffset.y,
				rcPos.Width(), rcPos.Height(), TRUE);
		}
	}

	ASSERT(m_hWnd != NULL);
	
	// Send message to overridable OnInitialUpdate.
	if (bInitialUpdate) {
		InitControlContainer();
		UpdateData(FALSE);
		PostMessage(WM_INITIALUPDATE, 0, 0);
	}

	return (m_hWnd != NULL);
}

//**************************************************************************
// Diagnostic routine to check for and decode dialog templates returns FALSE 
// if a program error occurs (i.e. bad resource ID or bad dialog styles). 
// Copied from MFC.
BOOL AFXAPI _AfxCheckDialogTemplate(LPCTSTR lpszResource, BOOL bInvisibleChild)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人一区二区三区在线观看| www.欧美.com| 国产一区在线观看麻豆| 国产精品99久| 欧美曰成人黄网| 欧美精品一区二区三区高清aⅴ| 国产精品午夜春色av| 久久午夜电影网| 亚洲在线视频一区| 91精品综合久久久久久| 九色porny丨国产精品| 国产一区二区伦理| 91精品婷婷国产综合久久性色| 精品国产伦一区二区三区观看方式| 中文字幕一区二区三区乱码在线| 五月天激情综合| 欧美综合亚洲图片综合区| 久久亚洲精品国产精品紫薇| 亚洲欧美色综合| 成人国产电影网| 18欧美亚洲精品| www.亚洲在线| 国产清纯在线一区二区www| 麻豆久久久久久| 精品日韩在线一区| 国产老妇另类xxxxx| 91精品国产综合久久香蕉的特点 | 亚洲欧美另类久久久精品| 国产精品综合av一区二区国产馆| 日韩亚洲欧美中文三级| 男男视频亚洲欧美| 国产午夜精品一区二区三区嫩草| 精品亚洲aⅴ乱码一区二区三区| 日韩欧美第一区| 国产91精品露脸国语对白| 国产精品久久久久四虎| 欧美天天综合网| 精品无码三级在线观看视频| 国产精品色呦呦| 欧美一级久久久久久久大片| 国产一区在线不卡| 亚洲欧美电影一区二区| 欧美精品久久久久久久多人混战| 日产国产欧美视频一区精品| 国产精品久久久久久久午夜片| 欧美三级在线看| 成人精品视频一区二区三区尤物| 亚洲蜜臀av乱码久久精品| 久久综合国产精品| 欧美精品aⅴ在线视频| jizz一区二区| 成人在线视频首页| 国内久久婷婷综合| 日韩影院在线观看| 亚洲一区二区三区三| 亚洲美女一区二区三区| 中国色在线观看另类| 国产亚洲短视频| 制服丝袜一区二区三区| 欧美三级三级三级爽爽爽| av中文字幕一区| 国产91丝袜在线播放九色| 婷婷国产v国产偷v亚洲高清| 久久精品视频在线免费观看| 国产欧美中文在线| 亚洲精品一区二区三区影院| 欧美tickle裸体挠脚心vk| 精品欧美乱码久久久久久| 欧美精品一区二区三区很污很色的 | 亚洲超碰精品一区二区| 亚洲精品videosex极品| 亚洲成人精品在线观看| 亚洲电影视频在线| 香蕉久久一区二区不卡无毒影院 | 在线播放欧美女士性生活| 国产伦精品一区二区三区免费| 午夜精品一区二区三区三上悠亚| 欧美色男人天堂| 91亚洲精品一区二区乱码| 国产精品一二一区| 一本大道久久a久久综合| 91福利区一区二区三区| 欧美少妇xxx| 成人永久aaa| 91 com成人网| 亚洲美女淫视频| 成人一区在线观看| 欧美xxxxx牲另类人与| 石原莉奈在线亚洲三区| 波多野结衣91| 久久久久国产精品麻豆| 午夜精品久久久久久久99樱桃| 国产精品一区二区久久不卡| 在线国产亚洲欧美| 国产精品第五页| 精品在线观看视频| 欧美日韩成人一区二区| 国产精品乱码妇女bbbb| 国产成人免费av在线| 日韩精品中文字幕在线一区| 蜜臀va亚洲va欧美va天堂 | 亚洲激情校园春色| 色综合一个色综合| 欧美激情一区二区三区四区| 亚洲成人1区2区| 精品视频在线免费看| 成人av网站免费| 久久色成人在线| 久久丁香综合五月国产三级网站| 欧美最新大片在线看| 蜜桃av一区二区| 99精品欧美一区二区蜜桃免费| 欧美性视频一区二区三区| 一区二区在线看| 51精品秘密在线观看| 国内精品伊人久久久久影院对白| 欧美亚洲动漫精品| 欧美日韩aaaaaa| 国产成人精品一区二区三区网站观看| 欧美精品一区二区久久久| 色综合一区二区三区| 日韩一区二区三区四区 | 国产乱码精品一品二品| 国产精品视频在线看| 日韩午夜av电影| 欧美三级午夜理伦三级中视频| 久久99国产精品尤物| 伊人夜夜躁av伊人久久| 欧美激情一区二区三区全黄| 欧美四级电影在线观看| 成人a免费在线看| 久久99热99| 日韩国产一区二| 日韩av网站在线观看| 樱花草国产18久久久久| 亚洲色图清纯唯美| 国产精品网曝门| 日韩一区在线看| 久久精品一二三| 日本一区二区三区四区| 欧美国产激情二区三区| 日韩欧美国产三级电影视频| 色综合久久六月婷婷中文字幕| 99热精品一区二区| 精品视频一区二区三区免费| 色婷婷亚洲精品| 欧美日韩mp4| 日韩久久精品一区| 国产欧美一区视频| 亚洲天堂中文字幕| 水野朝阳av一区二区三区| 日本vs亚洲vs韩国一区三区二区| 六月婷婷色综合| 不卡一区二区中文字幕| 欧美天堂一区二区三区| 日韩一级片在线观看| 欧美电影在哪看比较好| 日本一区二区三区电影| 亚洲欧美日韩中文播放| 三级影片在线观看欧美日韩一区二区| 蜜臀av在线播放一区二区三区| www.日韩av| 日韩一区二区三| 国产精品女同一区二区三区| 中文字幕一区二区三区在线播放| 亚洲精品免费看| 粉嫩欧美一区二区三区高清影视| 欧美在线一二三四区| 国产精品伦理在线| 精一区二区三区| 制服丝袜av成人在线看| 亚洲成av人片一区二区三区| 国产美女精品人人做人人爽| 日韩三级视频在线看| 亚洲国产精品传媒在线观看| 国产专区综合网| 久久久蜜桃精品| 国产一区二区三区视频在线播放| 日韩精品在线一区二区| 蜜桃精品视频在线| 日韩精品一区二区三区中文不卡| 日韩电影一区二区三区四区| 6080国产精品一区二区| 午夜精品一区二区三区电影天堂 | 午夜免费欧美电影| 欧美日韩一区二区三区高清 | 国产精品乱码一区二区三区软件| 久久国产乱子精品免费女| 国产夜色精品一区二区av| 国产91精品露脸国语对白| 一区二区三区在线视频观看| 欧美丝袜丝交足nylons图片| 午夜在线电影亚洲一区| 亚洲精品一区二区三区在线观看| 国产成人av一区二区| 一区二区三区在线高清| 91麻豆精品国产91| 成人18精品视频| 视频一区视频二区中文| 久久精品视频在线免费观看|