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.

108 lines
4.1 KiB

  1. // window class name of More Programs pane control
  2. #define WC_MOREPROGRAMS TEXT("Desktop More Programs Pane")
  3. class CMorePrograms
  4. : public IDropTarget
  5. , public CAccessible
  6. {
  7. public:
  8. /*
  9. * Interface stuff...
  10. */
  11. // *** IUnknown ***
  12. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvOut);
  13. STDMETHODIMP_(ULONG) AddRef();
  14. STDMETHODIMP_(ULONG) Release();
  15. // *** IDropTarget ***
  16. STDMETHODIMP DragEnter(IDataObject *pdto, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  17. STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  18. STDMETHODIMP DragLeave();
  19. STDMETHODIMP Drop(IDataObject *pdto, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  20. // *** IAccessible overridden methods ***
  21. STDMETHODIMP get_accRole(VARIANT varChild, VARIANT *pvarRole);
  22. STDMETHODIMP get_accState(VARIANT varChild, VARIANT *pvarState);
  23. STDMETHODIMP get_accKeyboardShortcut(VARIANT varChild, BSTR *pszKeyboardShortcut);
  24. STDMETHODIMP get_accDefaultAction(VARIANT varChild, BSTR *pszDefAction);
  25. STDMETHODIMP accDoDefaultAction(VARIANT varChild);
  26. private:
  27. CMorePrograms(HWND hwnd);
  28. ~CMorePrograms();
  29. static LRESULT CALLBACK s_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  30. LRESULT _OnNCCreate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  31. LRESULT _OnCreate(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  32. LRESULT _OnDestroy(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  33. LRESULT _OnNCDestroy(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  34. LRESULT _OnCtlColorBtn(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  35. LRESULT _OnDrawItem(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  36. LRESULT _OnCommand(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  37. LRESULT _OnSysColorChange(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  38. LRESULT _OnDisplayChange(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  39. LRESULT _OnSettingChange(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  40. LRESULT _OnContextMenu(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  41. LRESULT _OnEraseBkgnd(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  42. LRESULT _OnNotify(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  43. LRESULT _OnSMNFindItem(PSMNDIALOGMESSAGE pdm);
  44. LRESULT _OnSMNShowNewAppsTip(PSMNMBOOL psmb);
  45. LRESULT _OnSMNDismiss();
  46. void _InitMetrics();
  47. HWND _CreateTooltip();
  48. void _PopBalloon();
  49. void _TrackShellMenu(DWORD dwFlags);
  50. friend BOOL MorePrograms_RegisterClass();
  51. enum { IDC_BUTTON = 1,
  52. IDC_KEYPRESS = 2 };
  53. private:
  54. HWND _hwnd;
  55. HWND _hwndButton;
  56. HWND _hwndTT;
  57. HWND _hwndBalloon;
  58. HTHEME _hTheme;
  59. HFONT _hf;
  60. HFONT _hfTTBold; // Bold tooltip font
  61. HFONT _hfMarlett;
  62. HBRUSH _hbrBk; // Always a stock object
  63. IDropTargetHelper *_pdth; // For friendly-looking drag/drop
  64. COLORREF _clrText;
  65. COLORREF _clrTextHot;
  66. COLORREF _clrBk;
  67. int _colorHighlight; // GetSysColor
  68. int _colorHighlightText; // GetSysColor
  69. DWORD _tmHoverStart; // When did the user start a drag/drop hover?
  70. // Assorted metrics for painting
  71. int _tmAscent; // Ascent of main font
  72. int _tmAscentMarlett; // Ascent of Marlett font
  73. int _cxText; // width of entire client text
  74. int _cxTextIndent; // distance to beginning of text
  75. int _cxArrow; // width of the arrow image or glyph
  76. MARGINS _margins; // margins for the proglist listview
  77. int _iTextCenterVal; // space added to top of text to center with arrow bitmap
  78. RECT _rcExclude; // Exclusion rectangle for when the menu comes up
  79. // More random stuff
  80. LONG _lRef; // reference count
  81. TCHAR _chMnem; // Mnemonic
  82. BOOL _fMenuOpen; // Is the menu open?
  83. IShellMenu *_psmPrograms; // Cached ShellMenu for perf
  84. // Large things go at the end
  85. TCHAR _szMessage[128];
  86. };