Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.2 KiB

  1. // KeyocxCtrl.h : Declaration of the CKeyocxCtrl
  2. #ifndef __KEYOCXCTRL_H_
  3. #define __KEYOCXCTRL_H_
  4. #include "resource.h" // main symbols
  5. #include <mshtml.h>
  6. #include <wininet.h>
  7. /////////////////////////////////////////////////////////////////////////////
  8. // CKeyocxCtrl
  9. class ATL_NO_VTABLE CKeyocxCtrl :
  10. public CComObjectRootEx<CComSingleThreadModel>,
  11. public CComCoClass<CKeyocxCtrl,&CLSID_KeyocxCtrl>,
  12. public CComControl<CKeyocxCtrl>,
  13. public IDispatchImpl<IKeyocxCtrl, &IID_IKeyocxCtrl, &LIBID_KEYOCXLib>,
  14. public IPersistStreamInitImpl<CKeyocxCtrl>,
  15. public IOleControlImpl<CKeyocxCtrl>,
  16. public IOleObjectImpl<CKeyocxCtrl>,
  17. public IOleInPlaceActiveObjectImpl<CKeyocxCtrl>,
  18. public IViewObjectExImpl<CKeyocxCtrl>,
  19. public IOleInPlaceObjectWindowlessImpl<CKeyocxCtrl>,
  20. public IObjectSafetyImpl<CKeyocxCtrl>
  21. {
  22. public:
  23. CKeyocxCtrl()
  24. {
  25. }
  26. DECLARE_REGISTRY_RESOURCEID(IDR_KEYOCXCTRL)
  27. BEGIN_COM_MAP(CKeyocxCtrl)
  28. COM_INTERFACE_ENTRY(IDispatch)
  29. COM_INTERFACE_ENTRY(IKeyocxCtrl)
  30. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx)
  31. COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx)
  32. COM_INTERFACE_ENTRY_IMPL(IViewObjectEx)
  33. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleWindow, IOleInPlaceObjectWindowless)
  34. COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
  35. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless)
  36. COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
  37. COM_INTERFACE_ENTRY_IMPL(IOleControl)
  38. COM_INTERFACE_ENTRY_IMPL(IOleObject)
  39. COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
  40. COM_INTERFACE_ENTRY_IMPL(IObjectSafety)
  41. END_COM_MAP()
  42. BEGIN_PROPERTY_MAP(CKeyocxCtrl)
  43. // Example entries
  44. // PROP_ENTRY("Property Description", dispid, clsid)
  45. // PROP_PAGE(CLSID_StockColorPage)
  46. END_PROPERTY_MAP()
  47. BEGIN_MSG_MAP(CKeyocxCtrl)
  48. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  49. MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
  50. MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
  51. END_MSG_MAP()
  52. // IViewObjectEx
  53. STDMETHOD(GetViewStatus)(DWORD* pdwStatus)
  54. {
  55. ATLTRACE(_T("IViewObjectExImpl::GetViewStatus\n"));
  56. *pdwStatus = VIEWSTATUS_SOLIDBKGND | VIEWSTATUS_OPAQUE;
  57. return S_OK;
  58. }
  59. // IObjectSafety
  60. STDMETHOD(GetInterfaceSafetyOptions)(REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
  61. {
  62. ATLTRACE(_T("IObjectSafetyImpl::GetInterfaceSafetyOptions\n"));
  63. if (pdwSupportedOptions == NULL || pdwEnabledOptions == NULL)
  64. return E_POINTER;
  65. HRESULT hr = S_OK;
  66. if (riid == IID_IDispatch)
  67. {
  68. *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_CALLER;
  69. *pdwEnabledOptions = m_dwSafety & INTERFACESAFE_FOR_UNTRUSTED_CALLER;
  70. }
  71. else
  72. {
  73. *pdwSupportedOptions = 0;
  74. *pdwEnabledOptions = 0;
  75. hr = E_NOINTERFACE;
  76. }
  77. return hr;
  78. }
  79. STDMETHOD(SetInterfaceSafetyOptions)(REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions);
  80. // IKeyocxCtrl
  81. public:
  82. HRESULT OnDraw(ATL_DRAWINFO& di);
  83. STDMETHOD(CorpKeycode)(BSTR bstrBaseKey, BSTR *bstrKeycode);
  84. STDMETHOD(ISPKeycode)(BSTR bstrBaseKey, BSTR *bstrKeycode);
  85. };
  86. #endif //__KEYOCXCTRL_H_