Source code of Windows XP (NT5)
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.

151 lines
5.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: inplace.h
  7. //
  8. // Contents: Private API's and classes for the inplace OLE API's
  9. //
  10. // Classes: CFrameFilter
  11. //
  12. // Functions:
  13. //
  14. // History: dd-mmm-yy Author Comment
  15. // 24-Jan-94 alexgo first pass converting to Cairo style
  16. // memory allocation
  17. // 07-Dec-93 alexgo removed inlining
  18. // 01-Dec-93 alexgo 32bit port
  19. //
  20. //--------------------------------------------------------------------------
  21. #if !defined( _INPLACE_H_ )
  22. #define _INPLACE_H_
  23. // This ACCEL structure and the related constants definitions come with WIN32.
  24. // Win31 also uses the same stuff internally but it's not exposed in the
  25. // header files.
  26. #ifndef FVIRTKEY
  27. #define FVIRTKEY TRUE // Assumed to be == TRUE
  28. #define FLASTKEY 0x80 // Indicates last key in the table
  29. #define FNOINVERT 0x02
  30. #define FSHIFT 0x04
  31. #define FCONTROL 0x08
  32. #define FALT 0x10
  33. #pragma pack(1)
  34. typedef struct tagACCEL { // Accelerator Table structure
  35. BYTE fVirt;
  36. WORD key;
  37. WORD cmd;
  38. } ACCEL, FAR* LPACCEL;
  39. #pragma pack()
  40. #endif // FVIRTKEY
  41. // private structures
  42. typedef struct tagOLEMENUITEM
  43. {
  44. UINT item; // index or hwnd
  45. WORD fwPopup;
  46. BOOL fObjectMenu;
  47. } OLEMENUITEM;
  48. typedef OLEMENUITEM FAR* LPOLEMENUITEM;
  49. typedef struct tagOLEMENU
  50. {
  51. WORD wSignature;
  52. DWORD hwndFrame; // Really a hwnd
  53. DWORD hmenuCombined; // Really a hmenu
  54. OLEMENUGROUPWIDTHS MenuWidths;
  55. LONG lMenuCnt;
  56. OLEMENUITEM menuitem[1];
  57. } OLEMENU;
  58. typedef OLEMENU FAR* LPOLEMENU;
  59. //+-------------------------------------------------------------------------
  60. //
  61. // Class: CFrameFilter
  62. //
  63. // Purpose: Gets attached to an apps window so we can store various
  64. // bits of relevant info
  65. //
  66. // Interface:
  67. //
  68. // History: dd-mmm-yy Author Comment
  69. // 01-Dec-93 alexgo 32bit port
  70. //
  71. // Notes: CSafeRefCount inherits CPrivAlloc
  72. //
  73. //--------------------------------------------------------------------------
  74. class FAR CFrameFilter : public CSafeRefCount
  75. {
  76. public:
  77. static HRESULT Create(LPOLEMENU lpOleMenu, HMENU hmenuCombined,
  78. HWND hwndFrame, HWND hwndActiveObj,
  79. LPOLEINPLACEFRAME lpFrame,
  80. LPOLEINPLACEACTIVEOBJECT lpActiveObj);
  81. CFrameFilter (HWND hwndFrame, HWND hwndActiveObj);
  82. ~CFrameFilter(void);
  83. LRESULT OnSysCommand(WPARAM uParam, LPARAM lParam);
  84. void OnEnterMenuMode(void);
  85. void OnExitMenuMode(void);
  86. void OnEnterAltTabMode(void);
  87. void OnExitAltTabMode(void);
  88. LRESULT OnMessage(UINT msg, WPARAM uParam, LPARAM lParam);
  89. void IsObjectMenu (UINT uMenuItem, UINT fwMenu);
  90. BOOL IsMenuCollision(WPARAM uParam, LPARAM lParam);
  91. BOOL DoContextSensitiveHelp();
  92. STDMETHOD(GetActiveObject) (
  93. LPOLEINPLACEACTIVEOBJECT *lplpActiveObj);
  94. void RemoveWndProc();
  95. private:
  96. HWND m_hwndObject;
  97. HWND m_hwndFrame;
  98. LPOLEINPLACEFRAME m_lpFrame;
  99. LPOLEINPLACEACTIVEOBJECT m_lpObject;
  100. WNDPROC m_lpfnPrevWndProc;
  101. BOOL m_fObjectMenu;
  102. BOOL m_fCurItemPopup;
  103. BOOL m_fInMenuMode;
  104. BOOL m_fDiscardWmCommand;
  105. BOOL m_fGotMenuCloseEvent;
  106. BOOL m_fRemovedWndProc;
  107. UINT m_cmdId;
  108. UINT_PTR m_uCurItemID;
  109. LPOLEMENU m_lpOleMenu;
  110. HMENU m_hmenuCombined;
  111. HWND m_hwndFocusOnEnter;
  112. int m_cAltTab;
  113. #ifdef _CHICAGO_
  114. BOOL m_fInNCACTIVATE;
  115. #endif
  116. };
  117. typedef CFrameFilter FAR* PCFRAMEFILTER;
  118. STDAPI_(LRESULT) FrameWndFilterProc (HWND hwnd, UINT msg, WPARAM uParam,
  119. LPARAM lParam);
  120. STDAPI_(LRESULT) MessageFilterProc(int nCode, WPARAM wParam,
  121. LPARAM lParam);
  122. BOOL IsMDIAccelerator(LPMSG lpMsg, WORD FAR* cmd);
  123. inline PCFRAMEFILTER wGetFrameFilterPtr(HWND hwndFrame);
  124. LPOLEMENU wGetOleMenuPtr(HOLEMENU holemenu);
  125. inline void wReleaseOleMenuPtr(HOLEMENU holemenu);
  126. #endif // _INPLACE_H