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.

88 lines
3.0 KiB

  1. #ifndef __C_DWTT_H__
  2. #define __C_DWTT_H__
  3. #include "ptt.h"
  4. inline LPVOID GetHWNDPtr(HWND hwnd)
  5. {
  6. #ifdef _WIN64
  7. return (LPVOID)::GetWindowLongPtr(hwnd, GWLP_USERDATA);
  8. #else
  9. return (LPVOID)::GetWindowLong(hwnd, GWL_USERDATA);
  10. #endif
  11. }
  12. inline LPVOID SetHWNDPtr(HWND hwnd, LPVOID lpVoid)
  13. {
  14. #ifdef _WIN64
  15. return (LPVOID)::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)lpVoid);
  16. #else
  17. return (LPVOID)::SetWindowLong(hwnd, GWL_USERDATA, (LONG)lpVoid);
  18. #endif
  19. }
  20. //----------------------------------------------------------------
  21. //Disabled Window ToolTip class
  22. //----------------------------------------------------------------
  23. // For Disabled Window Tool Tip data
  24. //----------------------------------------------------------------
  25. typedef struct tagXINFO {
  26. struct tagXINFO *next;
  27. INT whichEvent; //TTM_RELAYEVNET or TTM_RELAYEVENT_WITHUSERINFO
  28. TOOLTIPUSERINFO userInfo;
  29. TOOLINFOW toolInfoW;
  30. }XINFO, *LPXINFO;
  31. class CDWToolTip;
  32. typedef CDWToolTip *LPCDWToolTip;
  33. class CDWToolTip
  34. {
  35. public:
  36. CDWToolTip(HWND hwnd);
  37. ~CDWToolTip();
  38. BOOL Enable(HWND hwndToolTip, BOOL fEnable);
  39. void *operator new(size_t size);
  40. void operator delete(void *p);
  41. static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  42. private:
  43. LRESULT RealWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  44. LRESULT MsgCreate (HWND hwnd, WPARAM wParam, LPARAM lParam);
  45. LRESULT MsgPrintClient (HWND hwnd, WPARAM wParam, LPARAM lParam);
  46. LRESULT MsgPaint (HWND hwnd, WPARAM wParam, LPARAM lParam);
  47. LRESULT MsgTimer (HWND hwnd, WPARAM wParam, LPARAM lParam);
  48. LRESULT MsgDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam);
  49. LRESULT MsgSetFont (HWND hwnd, WPARAM wParam, LPARAM lParam);
  50. LRESULT TTM_SetDelayTime(HWND hwnd, WPARAM wParam, LPARAM lParam);
  51. LRESULT TTM_AddToolW (HWND hwnd, WPARAM wParam, LPARAM lParam);
  52. LRESULT TTM_DelToolW (HWND hwnd, WPARAM wParam, LPARAM lParam);
  53. LRESULT TTM_NewToolRectW(HWND hwnd, WPARAM wParam, LPARAM lParam);
  54. LRESULT TTM_RelayEventWithUserInfo(HWND hwnd, WPARAM wParam, LPARAM lParam);
  55. LRESULT TTM_RelayEvent(HWND hwnd, WPARAM wParam, LPARAM lParam);
  56. LRESULT TTM_GetSetToolInfoW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  57. LRESULT TTM_GetToolCount(HWND hwnd, WPARAM wParam, LPARAM lParam);
  58. BOOL SetWindowAnimate(HWND hwnd);
  59. LPWSTR GetTipTextW(VOID);
  60. INT GetTipSize (LPSIZE lpSize);
  61. INT DrawTipText (HDC hDC, LPRECT lpRc, LPWSTR lpwstr);
  62. BOOL IsMousePointerIn(VOID);
  63. BOOL IsSameInfo(LPXINFO lpXInfo1, LPXINFO lpXInfo2);
  64. static POSVERSIONINFO GetVersionInfo();
  65. static BOOL IsWinNT4(VOID);
  66. static BOOL IsWinNT5(VOID);
  67. static BOOL IsWinNT(VOID);
  68. static BOOL IsWin98(VOID);
  69. static BOOL IsWin95(VOID);
  70. private:
  71. HWND m_hwndSelf;
  72. HFONT m_hFont;
  73. BOOL m_fShow; //Already show or not;
  74. DWORD m_dwDelayFlag;
  75. DWORD m_dwDelayTime;
  76. DWORD m_dwDurationTime;
  77. LPXINFO m_lpXInfoHead;
  78. LPXINFO m_lpXInfoCur;
  79. XINFO m_xInfoPrev; //New 971104
  80. MSG m_curRelayMsg;
  81. BOOL m_fEnable; //if FALSE never show tooltip;
  82. };
  83. #endif // __C_DWTT_H__