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.

114 lines
3.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: inplace.h
  7. //
  8. // Contents: inplace.h from OLE2
  9. //
  10. // History: 11-Apr-94 DrewB Copied from OLE2
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined( _INPLACE_H_ )
  14. #define _INPLACE_H_
  15. // This ACCEL structure and the related constants definitions come with WIN32.
  16. // Win31 also uses the same stuff internally but it's not exposed in the
  17. // header files.
  18. #ifndef FVIRTKEY
  19. #define FVIRTKEY TRUE // Assumed to be == TRUE
  20. #define FLASTKEY 0x80 // Indicates last key in the table
  21. #define FNOINVERT 0x02
  22. #define FSHIFT 0x04
  23. #define FCONTROL 0x08
  24. #define FALT 0x10
  25. #pragma pack(1)
  26. typedef struct tagACCEL { // Accelerator Table structure
  27. BYTE fVirt;
  28. WORD key;
  29. WORD cmd;
  30. } ACCEL, FAR* LPACCEL;
  31. #pragma pack()
  32. #endif // FVIRTKEY
  33. typedef struct tagOLEMENUITEM {
  34. UINT item;
  35. WORD fwPopup;
  36. BOOL fObjectMenu;
  37. } OLEMENUITEM;
  38. typedef OLEMENUITEM FAR* LPOLEMENUITEM;
  39. typedef struct tagOLEMENU {
  40. WORD wSignature;
  41. HWND hwndFrame;
  42. HMENU hmenuCombined;
  43. OLEMENUGROUPWIDTHS MenuWidths;
  44. LONG lMenuCnt;
  45. OLEMENUITEM menuitem[1];
  46. } OLEMENU;
  47. typedef OLEMENU FAR* LPOLEMENU;
  48. class FAR CFrameFilter
  49. {
  50. public:
  51. static HRESULT Create(HOLEMENU hOleMenu, HMENU hmenuCombined,
  52. HWND hwndFrame, HWND hwndActiveObj,
  53. LPOLEINPLACEFRAME lpFrame,
  54. LPOLEINPLACEACTIVEOBJECT lpActiveObj);
  55. CFrameFilter (HWND hwndFrame, HWND hwndActiveObj);
  56. ~CFrameFilter(void);
  57. inline LRESULT OnSysCommand(UINT uParam, LONG lParam);
  58. inline void OnEnterMenuMode(void);
  59. inline void OnExitMenuMode(void);
  60. inline void OnEnterAltTabMode(void);
  61. inline void OnExitAltTabMode(void);
  62. inline LRESULT OnMessage(UINT msg, UINT uParam, LONG lParam);
  63. inline void IsObjectMenu (UINT uMenuItem, UINT fwMenu);
  64. inline BOOL IsMenuCollision(UINT uParam, LONG lParam);
  65. inline BOOL DoContextSensitiveHelp();
  66. private:
  67. HWND m_hwndObject;
  68. HWND m_hwndFrame;
  69. LPOLEINPLACEFRAME m_lpFrame;
  70. LPOLEINPLACEACTIVEOBJECT m_lpObject;
  71. WNDPROC m_lpfnPrevWndProc;
  72. BOOL m_fObjectMenu;
  73. BOOL m_fCurItemPopup;
  74. BOOL m_fInMenuMode;
  75. BOOL m_fDiscardWmCommand;
  76. BOOL m_fGotMenuCloseEvent;
  77. UINT m_cmdId;
  78. UINT m_uCurItemID;
  79. HOLEMENU m_hOleMenu;
  80. HMENU m_hmenuCombined;
  81. HWND m_hwndFocusOnEnter;
  82. int m_cAltTab;
  83. };
  84. typedef CFrameFilter FAR* PCFRAMEFILTER;
  85. OLEAPI_(LRESULT) FrameWndFilterProc (HWND hwnd, UINT msg, UINT uParam, LONG lParam);
  86. OLEAPI_(LRESULT) MessageFilterProc(int nCode, WPARAM wParam, LPARAM lParam);
  87. BOOL IsMDIAccelerator(LPMSG lpMsg, WORD FAR* cmd);
  88. inline PCFRAMEFILTER wGetFrameFilterPtr(HWND hwndFrame);
  89. LPOLEMENU wGetOleMenuPtr(HOLEMENU holemenu);
  90. inline void wReleaseOleMenuPtr(HOLEMENU holemenu);
  91. inline UINT wSysKeyToKey(LPMSG lpMsg);
  92. #endif // _INPLACE_H