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

https://code.google.com/p/softart/ · C++ · 56 lines · 39 code · 10 blank · 7 comment · 11 complexity · a1e77488fc80b0fa5b7a83a830a41459 MD5 · raw file

  1. // [!output WTL_VIEW_FILE].cpp : implementation of the [!output WTL_VIEW_CLASS] class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. #include "resource.h"
  6. #include "[!output WTL_VIEW_FILE].h"
  7. BOOL [!output WTL_VIEW_CLASS]::PreTranslateMessage(MSG* pMsg)
  8. {
  9. [!if WTL_HOST_AX]
  10. if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
  11. (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
  12. return FALSE;
  13. HWND hWndCtl = ::GetFocus();
  14. if(IsChild(hWndCtl))
  15. {
  16. // find a direct child of the dialog from the window that has focus
  17. while(::GetParent(hWndCtl) != m_hWnd)
  18. hWndCtl = ::GetParent(hWndCtl);
  19. // give control a chance to translate this message
  20. if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0)
  21. return TRUE;
  22. }
  23. [!endif]
  24. [!if WTL_VIEWTYPE_HTML]
  25. if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) &&
  26. (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST))
  27. return FALSE;
  28. // give HTML page a chance to translate this message
  29. return (BOOL)SendMessage(WM_FORWARDMSG, 0, (LPARAM)pMsg);
  30. [!else]
  31. [!if WTL_VIEWTYPE_FORM]
  32. return CWindow::IsDialogMessage(pMsg);
  33. [!else]
  34. pMsg;
  35. return FALSE;
  36. [!endif]
  37. [!endif]
  38. }
  39. [!if WTL_VIEWTYPE_GENERIC]
  40. LRESULT [!output WTL_VIEW_CLASS]::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
  41. {
  42. CPaintDC dc(m_hWnd);
  43. //TODO: Add your drawing code here
  44. return 0;
  45. }
  46. [!endif]