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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? formctrl.cpp

?? Visual C++實踐與提高-劉刀桂, 孟繁晶編著
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
{
	ASSERT(lpszResource != NULL);
	HINSTANCE hInst = AfxFindResourceHandle(lpszResource, RT_DIALOG);
	HRSRC hResource = ::FindResource(hInst, lpszResource, RT_DIALOG);
	if (hResource == NULL)
	{
		if (HIWORD(lpszResource) != 0)
			TRACE1("ERROR: Cannot find dialog template named '%s'.\n",
				lpszResource);
		else
			TRACE1("ERROR: Cannot find dialog template with IDD 0x%04X.\n",
				LOWORD((DWORD)lpszResource));
		return FALSE;
	}

	if (!bInvisibleChild)
		return TRUE;        // that's all we need to check

	// we must check that the dialog template is for an invisible child
	//  window that can be used for a form-view or dialog-bar
	HGLOBAL hTemplate = LoadResource(hInst, hResource);
	if (hTemplate == NULL)
	{
		TRACE0("Warning: LoadResource failed for dialog template.\n");
		// this is only a warning, the real call to CreateDialog will fail
		return TRUE;        // not a program error - just out of memory
	}
	DLGTEMPLATEEX* pTemplate = (DLGTEMPLATEEX*)LockResource(hTemplate);
	DWORD dwStyle;
	if (pTemplate->signature == 0xFFFF)
		dwStyle = pTemplate->style;
	else
		dwStyle = ((DLGTEMPLATE*)pTemplate)->style;
	UnlockResource(hTemplate);
	FreeResource(hTemplate);

	if (dwStyle & WS_VISIBLE)
	{
		if (HIWORD(lpszResource) != 0)
			TRACE1("ERROR: Dialog named '%s' must be invisible.\n",
				lpszResource);
		else
			TRACE1("ERROR: Dialog with IDD 0x%04X must be invisible.\n",
				LOWORD((DWORD)lpszResource));
		return FALSE;
	}
	if (!(dwStyle & WS_CHILD))
	{
		if (HIWORD(lpszResource) != 0)
			TRACE1("ERROR: Dialog named '%s' must have the child style.\n",
				lpszResource);
		else
			TRACE1("ERROR: Dialog with IDD 0x%04X must have the child style.\n",
				LOWORD((DWORD)lpszResource));
		return FALSE;
	}

	return TRUE;
}

//**************************************************************************
// Handles keyboard and mouse processing such as tabbing through the  
// form control.
BOOL CFormControl::PreTranslateMessage(MSG* pMsg)
{
	ASSERT(pMsg != NULL);
	CWnd*	pWndFocus = CWnd::GetFocus();
	BOOL	bDefault = TRUE;

	if (m_hWnd) {
		// If an OLE Control has the focus, then give it the first crack at key
		// and mouse messages.

		HWND hWndFocus = pWndFocus->GetSafeHwnd();
		UINT uMsg = pMsg->message;

		if (((uMsg >= WM_KEYFIRST) && (uMsg <= WM_KEYLAST)) ||
			((uMsg >= WM_MOUSEFIRST) && (uMsg <= WM_MOUSELAST)))
		{
			CWnd2* pWndCtrl = (CWnd2*)pWndFocus;

			// Walk up the parent chain, until we find an OLE control.
			while ((pWndCtrl != NULL) && (pWndCtrl->GetControlSite() == NULL) &&
				(pWndCtrl->GetParent() != this))
			{
				pWndCtrl = (CWnd2*)pWndCtrl->GetParent();
			}

			if ((pWndCtrl != NULL) && (pWndCtrl->GetControlSite() != NULL) &&
				(pWndCtrl->GetControlSite()->m_pActiveObject != NULL) &&
				(pWndCtrl->GetControlSite()->m_pActiveObject->TranslateAccelerator(
					pMsg) == S_OK))
			{
				return TRUE;
			}
		}

		HWND hFirstDlgItem = ::GetNextDlgTabItem(m_hWnd, NULL, FALSE);
		HWND hLastDlgItem = ::GetNextDlgTabItem(m_hWnd, hFirstDlgItem, TRUE);
		BOOL ShiftKey = ::GetKeyState(VK_SHIFT) < 0;
	
		// Check OLE controls for boundry conditions
		switch (uMsg)
		{
			case WM_KEYDOWN:
			{
				switch (LOWORD(pMsg->wParam))
				{
					case VK_LEFT:
					case VK_UP:
					{
						ShiftKey = TRUE;
					}

					case VK_TAB:
					case VK_RIGHT:
					case VK_DOWN:
					{
						if (ShiftKey) {
							// Are we at the first control on the form and moving up?
							if (hWndFocus == hFirstDlgItem) {
								CWnd* pCntr = GetOuterWindow()->GetParent();
								if (pCntr && pCntr->GetNextDlgTabItem(this, TRUE) != this) {
									bDefault = FALSE;
								}
							}
						// Are we at the last control on the form and moving down?
						}else if (hWndFocus == hLastDlgItem) {
							CWnd* pCntr = GetOuterWindow()->GetParent();
							if (pCntr && pCntr->GetNextDlgTabItem(this, FALSE) != this) {
								bDefault = FALSE;
							}
						}
					}
				}
			}
		}

		if (bDefault) {
			return PreTranslateInput(pMsg);
		}else{
			// Update the default push button's control ID.
			::SendMessage(m_hWnd,DM_SETDEFID, 0L, 0L);
			// Reset the current default push button to a regular button.
			UINT bn_style = (UINT)GetWindowLong(pWndFocus->m_hWnd, GWL_STYLE) & 0xff;
			if (bn_style & BS_DEFPUSHBUTTON) {
				::SendMessage(pWndFocus->m_hWnd, BM_SETSTYLE, 
							  MAKELONG(0,bn_style & ~BS_DEFPUSHBUTTON), (LPARAM)TRUE);
			}

			return FALSE;
		}
	}else{
		return FALSE;
	}
}

//**************************************************************************
BEGIN_MESSAGE_MAP(CFormControl, COleControl)
	//{{AFX_MSG_MAP(CFormControl)
	ON_WM_SETFOCUS()
	ON_MESSAGE(WM_ACTIVATE_CONTROL, OnActivateControl)
	ON_WM_MOUSEACTIVATE()
	ON_WM_MOUSEMOVE()
	ON_WM_LBUTTONDBLCLK()
	ON_WM_LBUTTONDOWN()
	ON_WM_LBUTTONUP()
	ON_WM_MBUTTONDBLCLK()
	ON_WM_MBUTTONDOWN()
	ON_WM_MBUTTONUP()
	ON_WM_RBUTTONDBLCLK()
	ON_WM_RBUTTONDOWN()
	ON_WM_RBUTTONUP()
	//}}AFX_MSG_MAP
	// special command for Initial Update
	ON_MESSAGE_VOID(WM_INITIALUPDATE, OnInitialUpdate)
#ifndef _AFX_NO_OCC_SUPPORT
	ON_MESSAGE(WM_INITDIALOG, HandleInitDialog)
#endif
END_MESSAGE_MAP()

//**************************************************************************
// Reset the default button and set the focus to the appropriate child control
// on the form.
void CFormControl::OnSetFocus(CWnd* pOldWnd) 
{
	short ShiftState = ::GetKeyState(VK_SHIFT);
	short TabState = ::GetKeyState(VK_TAB);

	HWND hFirstDlgItem = ::GetNextDlgTabItem(m_hWnd, NULL, FALSE);
	HWND hLastDlgItem = ::GetNextDlgTabItem(m_hWnd, hFirstDlgItem, TRUE);

	// Set the focus to the appropriate child control in our form.
	if (TabState < 0) {
		if (ShiftState < 0) {
			m_hWndCurrentChild = hLastDlgItem;
		}else{
			m_hWndCurrentChild = hFirstDlgItem;
		}
	}else if ((::GetKeyState(VK_UP) < 0) || (GetKeyState(VK_LEFT) < 0)) {
		m_hWndCurrentChild = hLastDlgItem;
	}else if ((::GetKeyState(VK_DOWN) < 0) || (GetKeyState(VK_RIGHT) < 0)) {
		m_hWndCurrentChild = hFirstDlgItem;
	}else{
		m_hWndCurrentChild = ::GetFocus();
	}

	::SetFocus(m_hWndCurrentChild);
}

//**************************************************************************
// When a Child control gets the focus, it will send this message to 
// activate the Control.
LONG CFormControl::OnActivateControl(UINT, LONG) 
{
	if (!m_bUIActive)
	{
		OnActivateInPlace(TRUE, NULL);
		GetOuterWindow()->GetParent()->SendMessage(WM_ACTIVATE_CONTROL, 0, 0);
	}
	return 0;
}

//**************************************************************************
// Initialize the child controls.
void CFormControl::OnInitialUpdate()
{
	ASSERT_VALID(this);

	if (!UpdateData(FALSE))
		TRACE0("UpdateData failed during CFormControl initial update.\n");
}

//**************************************************************************
// Functions adding OLE control container support. Copied from MFC.
#ifndef _AFX_NO_OCC_SUPPORT

LRESULT CFormControl::HandleInitDialog(WPARAM, LPARAM)
{
	Default();  // allow default to initialize first (common dialogs/etc)

	// create OLE controls
	COccManager* pOccManager = afxOccManager;
	if ((pOccManager != NULL) && (m_pOccDialogInfo != NULL))
	{
		if (!pOccManager->CreateDlgControls(this, m_lpszTemplateName,
			m_pOccDialogInfo))
		{
			TRACE0("Warning: CreateDlgControls failed during form view init.\n");
			return FALSE;
		}
	}

	return TRUE;
}

BOOL CFormControl::SetOccDialogInfo(_AFX_OCC_DIALOG_INFO* pOccDialogInfo)
{
	m_pOccDialogInfo = pOccDialogInfo;
	return TRUE;
}

#endif //!_AFX_NO_OCC_SUPPORT


//**************************************************************************
// Remove the default flag fastBeginPaint so that the dialog template will 
// be allowed to draw itself.
DWORD CFormControl::GetControlFlags()
{
	return 0;
}

//**************************************************************************
// Draw a default design time representation of the control.
void CFormControl::OnDraw(
			CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
	if (!m_hWnd) {
		CPen* pOldPen = (CPen*)pdc->SelectStockObject(BLACK_PEN);
		CString temp = AmbientDisplayName();
		if (!temp.IsEmpty()) {
			m_sFormName = temp;
		}

		// Initialize template dimensions.
		CRect rc(rcBounds.left,
				 rcBounds.top,
				 rcBounds.left + m_cTemplateSize.cx,
				 rcBounds.top + m_cTemplateSize.cy);
		
		if (m_bAutoSize) {
			pdc->DrawEdge(rc, EDGE_SUNKEN, BF_RECT);
		}else{
			// Draw the current boundries in solid black.
			pdc->Rectangle(rcBounds);

			// Draw the template dimensions as EDGE_SUNKEN.
			pdc->DrawEdge(rc, EDGE_SUNKEN, BF_RECT);
		}

		// Print out the name of the form.
		pdc->SetTextAlign(TA_LEFT | TA_TOP);
		pdc->ExtTextOut(rcBounds.left + 10, rcBounds.top + 10,
			ETO_CLIPPED, rcBounds, m_sFormName, m_sFormName.GetLength(), NULL);

		pdc->SelectObject(pOldPen);
	}
}

//**************************************************************************
// Disable Mouse messages in the FormControl itself. We want this to pretend to be 
// the background.
int CFormControl::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message) 
{
	return MA_NOACTIVATE;
}

void CFormControl::OnMouseMove      (UINT nFlags, CPoint point) {}
void CFormControl::OnLButtonDblClk  (UINT nFlags, CPoint point) {}
void CFormControl::OnLButtonDown    (UINT nFlags, CPoint point) {}
void CFormControl::OnLButtonUp      (UINT nFlags, CPoint point) {}
void CFormControl::OnMButtonDblClk  (UINT nFlags, CPoint point) {}
void CFormControl::OnMButtonDown    (UINT nFlags, CPoint point) {}
void CFormControl::OnMButtonUp      (UINT nFlags, CPoint point) {}
void CFormControl::OnRButtonDblClk  (UINT nFlags, CPoint point) {}
void CFormControl::OnRButtonDown    (UINT nFlags, CPoint point) {}
void CFormControl::OnRButtonUp      (UINT nFlags, CPoint point) {}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区二区三区四区| 91麻豆精品国产自产在线| 亚洲成人三级小说| 久久毛片高清国产| 欧美日韩国产另类一区| 成人午夜在线视频| 激情五月激情综合网| 一级日本不卡的影视| 久久蜜桃av一区二区天堂| 91精品国产综合久久精品图片| 成人免费不卡视频| 麻豆精品一区二区| 亚洲成人1区2区| 18欧美亚洲精品| 国产欧美综合在线| 日韩视频免费观看高清完整版在线观看 | 日韩亚洲国产中文字幕欧美| 97久久超碰国产精品电影| 国产乱子轮精品视频| 秋霞电影网一区二区| 亚洲一区二区三区四区在线| 日韩一区日韩二区| 国产精品视频一二三| 久久久久久97三级| 精品国内片67194| 91精品久久久久久久91蜜桃| 欧美日韩一区二区三区在线 | 国产1区2区3区精品美女| 免费观看一级特黄欧美大片| 亚洲高清在线精品| 亚洲综合丁香婷婷六月香| 中文字幕一区二区不卡| 国产精品午夜在线| 欧美高清在线一区二区| 国产亚洲欧美在线| 国产免费成人在线视频| 精品国产乱码久久久久久夜甘婷婷| 在线91免费看| 91精品一区二区三区久久久久久| 欧美性色综合网| 欧美日韩一区二区三区四区五区 | 欧美激情综合五月色丁香| 久久婷婷国产综合国色天香| www日韩大片| 国产亚洲欧美色| 国产日韩欧美a| 国产亚洲自拍一区| 国产精品久久久久一区| 国产精品免费视频观看| 1000精品久久久久久久久| 最新欧美精品一区二区三区| 亚洲精品福利视频网站| 亚洲一区在线观看视频| 日韩精品亚洲专区| 久久99久国产精品黄毛片色诱| 精品一区二区在线观看| 国产河南妇女毛片精品久久久| 国产 欧美在线| 一本大道综合伊人精品热热 | 日韩午夜在线影院| 精品盗摄一区二区三区| 国产农村妇女精品| 一区二区三区免费看视频| 性久久久久久久久| 激情综合网天天干| 99re66热这里只有精品3直播 | 蜜臂av日日欢夜夜爽一区| 国产一区999| 91麻豆国产精品久久| 欧美日韩一本到| 精品国产3级a| 亚洲黄色尤物视频| 蜜桃精品视频在线| www.欧美.com| 欧美猛男gaygay网站| 久久久久国产成人精品亚洲午夜| 国产精品久久久久9999吃药| 亚洲成人在线网站| 国产东北露脸精品视频| 欧美亚洲免费在线一区| 欧美精品一区二区三区一线天视频| 国产精品人人做人人爽人人添| 亚洲国产精品精华液网站| 狠狠色综合播放一区二区| 99精品欧美一区| 91精品国产一区二区人妖| 日本一区二区久久| 日韩**一区毛片| 成人av在线网| 日韩精品中午字幕| 亚洲色图.com| 激情综合网av| 欧美日韩一区在线观看| 中文字幕欧美国产| 日产精品久久久久久久性色| 一本到一区二区三区| 久久久国产精华| 日韩影院在线观看| 色哟哟日韩精品| 久久久久久久精| 久久av资源站| 91麻豆精品国产91久久久资源速度 | 亚洲国产成人在线| 另类小说欧美激情| 欧美午夜电影在线播放| 中文无字幕一区二区三区| 免费成人小视频| 欧美日韩在线观看一区二区| 亚洲人成人一区二区在线观看 | 成人性生交大片免费看在线播放 | 亚洲成人1区2区| 一本大道综合伊人精品热热| 国产喷白浆一区二区三区| 精品在线播放免费| 6080亚洲精品一区二区| 一区二区视频在线| 成人爱爱电影网址| 国产精品三级在线观看| 国产成人午夜电影网| 亚洲精品一区二区精华| 青青草97国产精品免费观看| 欧美性猛交一区二区三区精品 | 国产精品一区二区x88av| 日韩欧美国产精品一区| 午夜欧美在线一二页| 91美女在线视频| 综合在线观看色| 99国产精品国产精品毛片| 欧美激情在线一区二区三区| 国产乱码字幕精品高清av| 精品国产网站在线观看| 美腿丝袜亚洲三区| 日韩视频不卡中文| 免费人成黄页网站在线一区二区| 欧美日韩精品电影| 偷偷要91色婷婷| 欧美一区二区播放| 天天操天天综合网| 91精品国产一区二区三区蜜臀| 秋霞国产午夜精品免费视频| 欧美一级黄色大片| 韩国在线一区二区| 精品国产91久久久久久久妲己| 国产自产v一区二区三区c| 久久免费视频色| av在线一区二区三区| 亚洲女厕所小便bbb| 在线观看视频欧美| 亚洲第一电影网| 日韩三级在线免费观看| 精品一区二区影视| 国产精品女主播在线观看| 99视频超级精品| 洋洋av久久久久久久一区| 欧美日本免费一区二区三区| 六月婷婷色综合| 国产色综合久久| 91亚洲精品乱码久久久久久蜜桃| 一区二区久久久| 欧美一区二区三区的| 国内成人免费视频| 国产精品久久三区| 欧美色视频在线| 另类欧美日韩国产在线| 欧美国产精品中文字幕| 欧美性高清videossexo| 蜜臀av在线播放一区二区三区| 久久人人爽爽爽人久久久| 成人高清在线视频| 亚洲成人激情av| 精品伦理精品一区| 91麻豆免费观看| 免费看日韩a级影片| 国产精品久久久久久久久久免费看 | 国产三级久久久| 97se亚洲国产综合自在线不卡 | 国产精品国产三级国产| 欧美丝袜自拍制服另类| 久久国产麻豆精品| 最新国产精品久久精品| 7777精品伊人久久久大香线蕉最新版| 久久99久久99小草精品免视看| 国产精品美女久久久久久久久| 欧美吞精做爰啪啪高潮| 精品一区二区三区免费视频| 亚洲欧美综合网| 精品国产亚洲在线| 欧美性猛交xxxx乱大交退制版 | 中文av一区特黄| 欧美日韩国产a| www.亚洲激情.com| 久久草av在线| 午夜在线电影亚洲一区| 欧美国产欧美综合| 欧美成人福利视频| 欧美日韩成人综合在线一区二区 | 色妹子一区二区| 国产一区二区三区黄视频| 亚洲国产中文字幕| 亚洲国产高清不卡|