PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

/3rd_party/wtl/AppWizCE/Files/Templates/1033/View.cpp

https://code.google.com/p/softart/
C++ | 56 lines | 39 code | 10 blank | 7 comment | 10 complexity | a1e77488fc80b0fa5b7a83a830a41459 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause, JSON, MPL-2.0-no-copyleft-exception, GPL-2.0, GPL-3.0, LGPL-3.0, BSD-2-Clause
 1// [!output WTL_VIEW_FILE].cpp : implementation of the [!output WTL_VIEW_CLASS] class
 2//
 3/////////////////////////////////////////////////////////////////////////////
 4
 5#include "stdafx.h"
 6#include "resource.h"
 7
 8#include "[!output WTL_VIEW_FILE].h"
 9
10BOOL [!output WTL_VIEW_CLASS]::PreTranslateMessage(MSG* pMsg)
11{
12[!if WTL_HOST_AX]
13	if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
14	   (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
15		return FALSE;
16
17	HWND hWndCtl = ::GetFocus();
18	if(IsChild(hWndCtl))
19	{
20		// find a direct child of the dialog from the window that has focus
21		while(::GetParent(hWndCtl) != m_hWnd)
22			hWndCtl = ::GetParent(hWndCtl);
23
24		// give control a chance to translate this message
25		if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0)
26			return TRUE;
27	}
28
29[!endif]
30[!if WTL_VIEWTYPE_HTML]
31	if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
32	   (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
33		return FALSE;
34
35	// give HTML page a chance to translate this message
36	return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
37[!else]
38[!if WTL_VIEWTYPE_FORM]
39	return CWindow::IsDialogMessage(pMsg);
40[!else]
41	pMsg;
42	return FALSE;
43[!endif]
44[!endif]
45}
46[!if WTL_VIEWTYPE_GENERIC]
47
48LRESULT [!output WTL_VIEW_CLASS]::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
49{
50	CPaintDC dc(m_hWnd);
51
52	//TODO: Add your drawing code here
53
54	return 0;
55}
56[!endif]