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.

665 lines
21 KiB

  1. #ifndef _TRAY_H
  2. #define _TRAY_H
  3. #include "trayp.h"
  4. #include "cwndproc.h"
  5. #ifdef __cplusplus
  6. #include "traynot.h"
  7. #include "ssomgr.h"
  8. typedef struct tagHWNDANDPLACEMENT
  9. {
  10. HWND hwnd;
  11. BOOL fRestore;
  12. WINDOWPLACEMENT wp;
  13. }
  14. HWNDANDPLACEMENT, *LPHWNDANDPLACEMENT;
  15. typedef struct tagAPPBAR
  16. {
  17. HWND hwnd;
  18. UINT uCallbackMessage;
  19. RECT rc;
  20. UINT uEdge;
  21. }
  22. APPBAR, *PAPPBAR;
  23. typedef struct tagWINDOWPOSITIONS
  24. {
  25. UINT idRes;
  26. HDSA hdsaWP;
  27. }
  28. WINDOWPOSITIONS, *LPWINDOWPOSITIONS;
  29. typedef struct tagTRAYVIEWOPTS
  30. {
  31. BOOL fAlwaysOnTop;
  32. BOOL fSMSmallIcons;
  33. BOOL fHideClock;
  34. BOOL fNoTrayItemsDisplayPolicyEnabled;
  35. BOOL fNoAutoTrayPolicyEnabled;
  36. BOOL fAutoTrayEnabledByUser;
  37. BOOL fShowQuickLaunch;
  38. UINT uAutoHide; // AH_HIDING , AH_ON
  39. }
  40. TRAYVIEWOPTS;
  41. // TVSD Flags.
  42. #define TVSD_NULL 0x0000
  43. #define TVSD_AUTOHIDE 0x0001
  44. #define TVSD_TOPMOST 0x0002
  45. #define TVSD_SMSMALLICONS 0x0004
  46. #define TVSD_HIDECLOCK 0x0008
  47. // old Win95 TVSD struct
  48. typedef struct _TVSD95
  49. {
  50. DWORD dwSize;
  51. LONG cxScreen;
  52. LONG cyScreen;
  53. LONG dxLeft;
  54. LONG dxRight;
  55. LONG dyTop;
  56. LONG dyBottom;
  57. DWORD uAutoHide;
  58. RECTL rcAutoHide;
  59. DWORD uStuckPlace;
  60. DWORD dwFlags;
  61. } TVSD95;
  62. // Nashville tray save data
  63. typedef struct _TVSD
  64. {
  65. DWORD dwSize;
  66. LONG lSignature; // signature (must be negative)
  67. DWORD dwFlags; // TVSD_ flags
  68. DWORD uStuckPlace; // current stuck edge
  69. SIZE sStuckWidths; // widths of stuck rects
  70. RECT rcLastStuck; // last stuck position in pixels
  71. } TVSD;
  72. // convenient union for reading either
  73. typedef union _TVSDCOMPAT
  74. {
  75. TVSD t; // new format
  76. TVSD95 w95; // old format
  77. } TVSDCOMPAT;
  78. #define TVSDSIG_CURRENT (-1L)
  79. #define IS_CURRENT_TVSD(t) ((t.dwSize >= sizeof(TVSD)) && (t.lSignature < 0))
  80. #define MAYBE_WIN95_TVSD(t) (t.dwSize == sizeof(TVSD95))
  81. DWORD _GetDefaultTVSDFlags();
  82. class CTray;
  83. class CDropTargetBase : public IDropTarget
  84. {
  85. public:
  86. // *** IUnknown methods ***
  87. STDMETHODIMP QueryInterface(REFIID riid, void ** ppvObj);
  88. STDMETHODIMP_(ULONG) AddRef();
  89. STDMETHODIMP_(ULONG) Release();
  90. // *** IDropTarget methods ***
  91. STDMETHODIMP DragEnter(IDataObject *pdtobj, DWORD grfKeyState, POINTL ptl, DWORD *pdwEffect);
  92. STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  93. STDMETHODIMP DragLeave();
  94. STDMETHODIMP Drop(IDataObject *pdtobj, DWORD grfKeyState, POINTL ptl, DWORD *pdwEffect);
  95. CDropTargetBase(CTray* ptray) : _ptray(ptray) {}
  96. protected:
  97. CTray* _ptray;
  98. };
  99. class CTrayDropTarget : public CDropTargetBase
  100. {
  101. public:
  102. // *** IDropTarget methods ***
  103. STDMETHODIMP DragEnter(IDataObject *pdtobj, DWORD grfKeyState, POINTL ptl, DWORD *pdwEffect);
  104. STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  105. CTrayDropTarget();
  106. };
  107. class CStartDropTarget : public CDropTargetBase
  108. {
  109. public:
  110. // *** IDropTarget methods ***
  111. STDMETHODIMP DragEnter(IDataObject *pdtobj, DWORD grfKeyState, POINTL ptl, DWORD *pdwEffect);
  112. STDMETHODIMP DragOver(DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  113. STDMETHODIMP DragLeave();
  114. STDMETHODIMP Drop(IDataObject *pdtobj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect);
  115. CStartDropTarget();
  116. protected:
  117. HRESULT _GetStartMenuDropTarget(IDropTarget** pptgt);
  118. void _StartAutoOpenTimer(POINTL *pptl);
  119. DWORD _dwEffectsAllowed;
  120. };
  121. class CDeskTray : public IDeskTray
  122. {
  123. public:
  124. // *** IUnknown methods ***
  125. STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  126. STDMETHODIMP_(ULONG)AddRef();
  127. STDMETHODIMP_(ULONG) Release();
  128. // *** IDeskTray methods ***
  129. STDMETHODIMP_(UINT) AppBarGetState();
  130. STDMETHODIMP GetTrayWindow(HWND* phwndTray);
  131. STDMETHODIMP SetDesktopWindow(HWND hwndDesktop);
  132. STDMETHODIMP SetVar(int var, DWORD value);
  133. protected:
  134. CDeskTray(); // noone but tray should instantiate
  135. CTray* _ptray;
  136. friend class CTray;
  137. };
  138. EXTERN_C void Tray_OnStartMenuDismissed();
  139. EXTERN_C void Tray_SetStartPaneActive(BOOL fActive);
  140. #define TPF_TASKBARPAGE 0x00000001
  141. #define TPF_STARTMENUPAGE 0x00000002
  142. #define TPF_INVOKECUSTOMIZE 0x00000004 // start with the "Customize..." sub-dialog open
  143. EXTERN_C void Tray_DoProperties(DWORD dwFlags);
  144. #define AH_OFF 0x00
  145. #define AH_ON 0x01
  146. #define AH_HIDING 0x02
  147. class CTray : public CImpWndProc
  148. {
  149. public:
  150. //
  151. // miscellaneous public methods
  152. //
  153. CTray();
  154. void HandleWindowDestroyed(HWND hwnd);
  155. void HandleFullScreenApp(HWND hwnd);
  156. void RealityCheck();
  157. DWORD getStuckPlace() { return _uStuckPlace; }
  158. void InvisibleUnhide(BOOL fShowWindow);
  159. void ContextMenuInvoke(int idCmd);
  160. HMENU BuildContextMenu(BOOL fIncludeTime);
  161. void AsyncSaveSettings();
  162. BOOL Init();
  163. void Unhide();
  164. void VerifySize(BOOL fWinIni, BOOL fRoundUp = FALSE);
  165. void SizeWindows();
  166. int HotkeyAdd(WORD wHotkey, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlItem, BOOL fClone);
  167. void CheckWindowPositions();
  168. void SaveWindowPositions(UINT idRes);
  169. void ForceStartButtonUp();
  170. void DoProperties(DWORD dwFlags);
  171. void LogFailedStartupApp();
  172. HWND GetTaskWindow() { return _hwndTasks; }
  173. HWND GetTrayTips() { return _hwndTrayTips; }
  174. IDeskTray* GetDeskTray() { return &_desktray; }
  175. IMenuPopup* GetStartMenu() { return _pmpStartMenu; };
  176. void StartMenuContextMenu(HWND hwnd, DWORD dwPos);
  177. BOOL IsTaskbarFading() { return _fTaskbarFading; };
  178. DWORD CountOfRunningPrograms();
  179. void ClosePopupMenus();
  180. HWND GetTrayNotifyHWND()
  181. {
  182. return _hwndNotify;
  183. }
  184. void CreateStartButtonBalloon(UINT idsTitle, UINT idsMessage);
  185. void GetTrayViewOpts(TRAYVIEWOPTS* ptvo)
  186. {
  187. ptvo->fAlwaysOnTop = _fAlwaysOnTop;
  188. ptvo->fSMSmallIcons = _fSMSmallIcons;
  189. ptvo->fHideClock = _fHideClock;
  190. ptvo->fNoTrayItemsDisplayPolicyEnabled = _trayNotify.GetIsNoTrayItemsDisplayPolicyEnabled();
  191. ptvo->fNoAutoTrayPolicyEnabled = _trayNotify.GetIsNoAutoTrayPolicyEnabled();
  192. ptvo->fAutoTrayEnabledByUser = _trayNotify.GetIsAutoTrayEnabledByUser();
  193. ptvo->uAutoHide = _uAutoHide; // AH_HIDING , AH_ON
  194. ptvo->fShowQuickLaunch = (-1 != SendMessage(_hwnd, WMTRAY_TOGGLEQL, 0, (LPARAM)-1));
  195. }
  196. void SetTrayViewOpts(const TRAYVIEWOPTS* ptvo)
  197. {
  198. _UpdateAlwaysOnTop(ptvo->fAlwaysOnTop);
  199. SendMessage(_hwnd, WMTRAY_TOGGLEQL, 0, (LPARAM)ptvo->fShowQuickLaunch);
  200. _fSMSmallIcons = ptvo->fSMSmallIcons;
  201. _fHideClock = ptvo->fHideClock;
  202. _uAutoHide = ptvo->uAutoHide; // AH_HIDING , AH_ON
  203. // There is no necessity to save the fNoAutoTrayPolicyEnabled,
  204. // fNoTrayItemsDisplayPolicyEnabled, fAutoTrayEnabledByUser settings...
  205. }
  206. BOOL GetIsNoToolbarsOnTaskbarPolicyEnabled() const
  207. {
  208. return _fNoToolbarsOnTaskbarPolicyEnabled;
  209. }
  210. STDMETHODIMP_(ULONG) AddRef() { return 2; }
  211. STDMETHODIMP_(ULONG) Release() { return 1; }
  212. //
  213. // miscellaneous public data
  214. //
  215. // from TRAYSTUFF
  216. BOOL _fCoolTaskbar;
  217. BOOL _bMainMenuInit;
  218. BOOL _fFlashing; // currently flashing (HSHELL_FLASH)
  219. BOOL _fStuckRudeApp;
  220. BOOL _fDeferedPosRectChange;
  221. BOOL _fSelfSizing;
  222. BOOL _fBalloonUp; // true if balloon notification is up
  223. BOOL _fIgnoreDoneMoving;
  224. BOOL _fShowSizingBarAlways;
  225. BOOL _fSkipErase;
  226. BOOL _fIsLogoff;
  227. HWND _hwndStart;
  228. HWND _hwndLastActive;
  229. IBandSite *_ptbs;
  230. UINT _uAutoHide; // AH_HIDING , AH_ON
  231. HBITMAP _hbmpStartBkg;
  232. HFONT _hFontStart;
  233. RECT _arStuckRects[4]; // temporary for hit-testing
  234. CTrayNotify _trayNotify;
  235. protected:
  236. // protected methods
  237. friend class CTaskBarPropertySheet;
  238. static DWORD WINAPI SyncThreadProc(void *pv);
  239. DWORD _SyncThreadProc();
  240. static DWORD WINAPI MainThreadProc(void *pv);
  241. int _GetPart(BOOL fSizingBar, UINT uStuckPlace);
  242. void _UpdateVertical(UINT uStuckPlace, BOOL fForce = FALSE);
  243. void _RaiseDesktop(BOOL fRaise, BOOL fRestoreWindows);
  244. BOOL _RestoreWindowPositions(BOOL fPostLowerDesktop);
  245. void _RestoreWindowPos();
  246. static BOOL SavePosEnumProc(HWND hwnd, LPARAM lParam);
  247. BOOL _IsPopupMenuVisible();
  248. BOOL _IsActive();
  249. void _AlignStartButton();
  250. void _GetWindowSizes(UINT uStuckPlace, PRECT prcClient, PRECT prcView, PRECT prcNotify);
  251. void _GetStuckDisplayRect(UINT uStuckPlace, LPRECT prcDisplay);
  252. void _Hide();
  253. HWND _GetClockWindow(void);
  254. HRESULT _LoadInProc(PCOPYDATASTRUCT pcds);
  255. LRESULT _CreateWindows();
  256. LRESULT _InitStartButtonEtc();
  257. void _AdjustMinimizedMetrics();
  258. void _MessageLoop();
  259. void _BuildStartMenu();
  260. void _DestroyStartMenu();
  261. int _TrackMenu(HMENU hmenu);
  262. static DWORD WINAPI RunDlgThreadProc(void *pv);
  263. DWORD _RunDlgThreadProc(HANDLE hdata);
  264. int _GetQuickLaunchID();
  265. int _ToggleQL(int iVisible);
  266. static BOOL TileEnumProc(HWND hwnd, LPARAM lParam);
  267. BOOL _CanTileAnyWindows()
  268. {
  269. return !EnumWindows(TileEnumProc, (LPARAM)this);
  270. }
  271. void _RegisterDropTargets();
  272. void _RevokeDropTargets();
  273. BOOL _UpdateAlwaysOnTop(BOOL fAlwaysOnTop);
  274. HMONITOR _GetDisplayRectFromRect(LPRECT prcDisplay, LPCRECT prcIn, UINT uFlags);
  275. HMONITOR _GetDisplayRectFromPoint(LPRECT prcDisplay, POINT pt, UINT uFlags);
  276. void _AdjustRectForSizingBar(UINT uStuckPlace, LPRECT prc, int iIncrement);
  277. void _MakeStuckRect(LPRECT prcStick, LPCRECT prcBound, SIZE size, UINT uStick);
  278. void _ScreenSizeChange(HWND hwnd);
  279. void _ContextMenu(DWORD dwPos, BOOL fSetTime);
  280. void _StuckTrayChange();
  281. void _ResetZorder();
  282. void _HandleSize();
  283. BOOL _HandleSizing(WPARAM code, LPRECT lprc, UINT uStuckPlace);
  284. void _RegisterGlobalHotkeys();
  285. void _UnregisterGlobalHotkeys();
  286. void _HandleGlobalHotkey(WPARAM wParam);
  287. void _SetAutoHideTimer();
  288. void _ComputeHiddenRect(LPRECT prc, UINT uStuck);
  289. UINT _GetDockedRect(LPRECT prc, BOOL fMoving);
  290. void _CalcClipCoords(RECT *prcClip, const RECT *prcMonitor, const RECT *prcNew);
  291. void _ClipInternal(const RECT *prcClip);
  292. void _ClipWindow(BOOL fEnableClipping);
  293. UINT _CalcDragPlace(POINT pt);
  294. UINT _RecalcStuckPos(LPRECT prc);
  295. void _AutoHideCollision();
  296. LRESULT _HandleMeasureItem(HWND hwnd, LPMEASUREITEMSTRUCT lpmi);
  297. void _OnDesktopState(LPARAM lParam);
  298. BOOL _ToggleLanguageBand(BOOL fShowIt);
  299. LRESULT _OnDeviceChange(HWND hwnd, WPARAM wParam, LPARAM lParam);
  300. DWORD _PtOnResizableEdge(POINT pt, LPRECT prcClient);
  301. BOOL _MapNCToClient(LPARAM* plParam);
  302. BOOL _TryForwardNCToClient(UINT uMsg, LPARAM lParam);
  303. LRESULT _OnSessionChange(WPARAM wParam, LPARAM lParam);
  304. LRESULT _NCPaint(HRGN hrgn);
  305. LRESULT v_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  306. BOOL _CanMinimizeAll();
  307. BOOL _MinimizeAll(BOOL fPostRaiseDesktop);
  308. void _Command(UINT idCmd);
  309. LONG _SetAutoHideState(BOOL fAutoHide);
  310. BOOL _ShouldWeShowTheStartButtonBalloon();
  311. void _DontShowTheStartButtonBalloonAnyMore();
  312. void _DestroyStartButtonBalloon();
  313. void _ShowStartButtonToolTip();
  314. void _ToolbarMenu();
  315. HFONT _CreateStartFont(HWND hwndTray);
  316. void _SaveTrayStuff(void);
  317. void _SaveTray(void);
  318. void _SaveTrayAndDesktop(void);
  319. void _SlideStep(HWND hwnd, const RECT *prcMonitor, const RECT *prcOld, const RECT *prcNew);
  320. void _DoExitWindows(HWND hwnd);
  321. static LRESULT WINAPI StartButtonSubclassWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  322. LRESULT _StartButtonSubclassWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  323. void _ResizeStuckRects(RECT *arStuckRects);
  324. static DWORD WINAPI PropertiesThreadProc(void* pv);
  325. DWORD _PropertiesThreadProc(DWORD dwFlags);
  326. int _RecomputeWorkArea(HWND hwndCause, HMONITOR hmon, LPRECT prcWork);
  327. void _StartButtonReset();
  328. void _RefreshStartMenu();
  329. void _ExploreCommonStartMenu(BOOL bExplore);
  330. BOOL _CreateClockWindow();
  331. void _CreateTrayTips();
  332. HWND _CreateStartButton();
  333. BOOL _InitTrayClass();
  334. void _SetStuckMonitor();
  335. void _GetSaveStateAndInitRects();
  336. LRESULT _OnCreateAsync();
  337. LRESULT _OnCreate(HWND hwnd);
  338. void _UpdateBandSiteStyle();
  339. void _InitBandsite();
  340. void _InitNonzeroGlobals();
  341. void _CreateTrayWindow();
  342. void _DoneMoving(LPWINDOWPOS lpwp);
  343. void _SnapshotStuckRectSize(UINT uPlace);
  344. void _RecomputeAllWorkareas();
  345. void _SlideWindow(HWND hwnd, RECT *prc, BOOL fShow);
  346. void _UnhideNow();
  347. void _HandleEnterMenuLoop();
  348. void _HandleExitMenuLoop();
  349. void _SetUnhideTimer(LONG x, LONG y);
  350. void _OnNewSystemSizes();
  351. static int WINAPI CheckWndPosEnumProc(void *pItem, void *pData);
  352. void _HandleTimer(WPARAM wTimerID);
  353. void _KickStartAutohide();
  354. void _HandleMoving(WPARAM wParam, LPRECT lprc);
  355. LRESULT _HandleDestroy();
  356. void _SetFocus(HWND hwnd);
  357. void _ActAsSwitcher();
  358. void _OnWinIniChange(HWND hwnd, WPARAM wParam, LPARAM lParam);
  359. LRESULT _ShortcutRegisterHotkey(HWND hwnd, WORD wHotkey, ATOM atom);
  360. LRESULT _SetHotkeyEnable(HWND hwnd, BOOL fEnable);
  361. void _HandleWindowPosChanging(LPWINDOWPOS lpwp);
  362. void _HandlePowerStatus(UINT uMsg, WPARAM wParam, LPARAM lParam);
  363. void _DesktopCleanup_GetFileTimeNDaysFromGivenTime(const FILETIME *pftGiven, FILETIME * pftReturn, int iDays);
  364. BOOL _DesktopCleanup_ShouldRun();
  365. void _CheckDesktopCleanup(void);
  366. static BOOL_PTR WINAPI RogueProgramFileDlgProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
  367. void _CheckForRogueProgramFile();
  368. void _OnWaitCursorNotify(LPNMHDR pnm);
  369. void _HandlePrivateCommand(LPARAM lParam);
  370. void _OnFocusMsg(UINT uMsg, WPARAM wParam, LPARAM lParam);
  371. int _OnFactoryMessage(WPARAM wParam, LPARAM lParam);
  372. int _OnTimerService(UINT uMsg, WPARAM wParam, LPARAM lParam);
  373. void _HandleDelayBootStuff();
  374. void _HandleChangeNotify(WPARAM wParam, LPARAM lParam);
  375. void _CheckStagingAreaOnTimer();
  376. BOOL _IsTopmost();
  377. void _RefreshSettings();
  378. static BOOL PropagateEnumProc(HWND hwnd, LPARAM lParam);
  379. void _PropagateMessage(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
  380. BOOL _IsAutoHide() { return _uAutoHide & AH_ON; }
  381. void _RunDlg();
  382. static void WINAPI SettingsUIPropSheetCallback(DWORD nStartPage);
  383. static DWORD WINAPI SettingsUIThreadProc(void *pv);
  384. static BOOL WINAPI FullScreenEnumProc(HMONITOR hmon, HDC hdc, LPRECT prc, LPARAM dwData);
  385. static BOOL WINAPI MonitorEnumProc(HMONITOR hMonitor, HDC hdc, LPRECT lprc, LPARAM lData);
  386. // appbar stuff
  387. HRESULT _AppBarSetState(UINT uFlags);
  388. void _AppBarActivationChange(PTRAYAPPBARDATA ptabd);
  389. BOOL _AppBarSetAutoHideBar(PTRAYAPPBARDATA ptabd);
  390. BOOL _AppBarSetAutoHideBar2(HWND hwnd, BOOL fAutoHide, UINT uEdge);
  391. void _AppBarActivationChange2(HWND hwnd, UINT uEdge);
  392. HWND _AppBarGetAutoHideBar(UINT uEdge);
  393. LRESULT _OnAppBarMessage(PCOPYDATASTRUCT pcds);
  394. void _AppBarSubtractRect(PAPPBAR pab, LPRECT lprc);
  395. void _AppBarSubtractRects(HMONITOR hmon, LPRECT lprc);
  396. void _StuckAppChange(HWND hwndCause, LPCRECT prcOld, LPCRECT prcNew, BOOL bTray);
  397. void _AppBarNotifyAll(HMONITOR hmon, UINT uMsg, HWND hwndExclude, LPARAM lParam);
  398. void _AppBarGetTaskBarPos(PTRAYAPPBARDATA ptabd);
  399. void _NukeAppBar(int i);
  400. void _AppBarRemove(PTRAYAPPBARDATA ptabd);
  401. PAPPBAR _FindAppBar(HWND hwnd);
  402. BOOL _AppBarNew(PTRAYAPPBARDATA ptabd);
  403. BOOL _AppBarOutsideOf(PAPPBAR pabReq, PAPPBAR pab);
  404. void _AppBarQueryPos(PTRAYAPPBARDATA ptabd);
  405. void _AppBarSetPos(PTRAYAPPBARDATA ptabd);
  406. // hotkey stuff
  407. void _HandleHotKey(int nID);
  408. LRESULT _ShortcutUnregisterHotkey(HWND hwnd, WORD wHotkey);
  409. LRESULT _RegisterHotkey(HWND hwnd, int i);
  410. LRESULT _UnregisterHotkey(HWND hwnd, int i);
  411. HWND _HotkeyInUse(WORD wHK);
  412. int _RestoreHotkeyList(HWND hwnd);
  413. UINT _HotkeyGetFreeItemIndex(void);
  414. int _HotkeyAddCached(WORD wGHotkey, LPITEMIDLIST pidl);
  415. int _HotkeySave(void);
  416. int _HotkeyRemove(WORD wHotkey);
  417. int _HotkeyRemoveCached(WORD wGHotkey);
  418. BOOL _HotkeyCreate(void);
  419. // Startup troubleshooter stuff
  420. static void WINAPI TroubleShootStartupCB(HWND hwnd, UINT uMsg, UINT_PTR idTimer, DWORD dwTime);
  421. void _OnHandleStartupFailed();
  422. // App compat stuff
  423. static void CALLBACK _MigrateOldBrowserSettingsCB(PVOID lpParameter, BOOLEAN);
  424. void _MigrateOldBrowserSettings();
  425. // protected data
  426. HWND _hwndNotify; // clock window
  427. HWND _hwndStartBalloon;
  428. HWND _hwndRude;
  429. HWND _hwndTrayTips;
  430. HWND _hwndTasks;
  431. HMENU _hmenuStart;
  432. SIZE _sizeStart; // height/width of the start button
  433. SIZE _sizeSizingBar;
  434. int _iAlpha;
  435. HIMAGELIST _himlStartFlag;
  436. CShellServiceObjectMgr _ssomgr;
  437. CStartDropTarget _dtStart;
  438. CTrayDropTarget _dtTray;
  439. CDeskTray _desktray;
  440. #define MM_OTHER 0x01
  441. #define MM_SHUTDOWN 0x02
  442. UINT _uModalMode;
  443. BOOL _fAlwaysOnTop;
  444. BOOL _fSMSmallIcons;
  445. BOOL _fGlobalHotkeyDisable;
  446. BOOL _fThreadTerminate;
  447. BOOL _fSysSizing; // being sized by user; hold off on recalc
  448. BOOL _fHideClock;
  449. BOOL _fShouldResize;
  450. BOOL _fMonitorClipped;
  451. BOOL _fHandledDelayBootStuff;
  452. BOOL _fUndoEnabled;
  453. BOOL _fProcessingDesktopRaise;
  454. BOOL _fFromStart; // Track when context menu popping up from Start button
  455. BOOL _fTaskbarFading;
  456. BOOL _fNoToolbarsOnTaskbarPolicyEnabled;
  457. POINT _ptLastHittest;
  458. HWND _hwndRun;
  459. HWND _hwndProp;
  460. HWND _hwndRebar;
  461. HACCEL _hMainAccel; // Main accel table
  462. int _iWaitCount;
  463. HDPA _hdpaAppBars; // app bar info
  464. HDSA _hdsaHKI; // hotkey info
  465. CRITICAL_SECTION _csHotkey; // Protects _hdsaHKI, hotkey info
  466. LPWINDOWPOSITIONS _pPositions; // saved windows positions (for undo of minimize all)
  467. UINT _uStuckPlace; // the stuck place
  468. SIZE _sStuckWidths; // width/height of tray
  469. UINT _uMoveStuckPlace; // stuck status during a move operation
  470. // these two must go together for save reasons
  471. RECT _rcOldTray; // last place we stuck ourselves (for work area diffs)
  472. HMONITOR _hmonStuck; // The current HMONITOR we are on
  473. HMONITOR _hmonOld; // The last hMonitor we were on
  474. IMenuBand* _pmbStartMenu; //For Message translation.
  475. IMenuPopup* _pmpStartMenu; //For start menu cache
  476. IMenuBand* _pmbStartPane; // For Message translation.
  477. IMenuPopup* _pmpStartPane; // For navigating the start pane
  478. void * _pvStartPane; // For delayed initilization
  479. IStartMenuPin *_psmpin; // For drag/drop to Start Button
  480. IMenuBand* _pmbTasks; //For Message translation.
  481. IMenuPopup* _pmpTasks;
  482. IDeskBand* _pdbTasks;
  483. WNDPROC _pfnButtonProc; // Button subclass.
  484. UINT _uDown;
  485. BOOL _fAllowUp; // Is the start button allowed to be in the up position?
  486. UINT _uStartButtonState; // crazy state machine -- see Tray_SetStartPaneActive
  487. DWORD _tmOpen; // time the Start Menu was opened (for debouncing)
  488. int _cHided;
  489. int _cyTrayBorders;
  490. HTHEME _hTheme;
  491. //
  492. // amount of time to show/hide the tray
  493. // to turn sliding off set these to 0
  494. //
  495. int _dtSlideHide;
  496. int _dtSlideShow;
  497. HWND _hwndFocusBeforeRaise;
  498. BOOL _fMinimizedAllBeforeRaise;
  499. BOOL _fCanSizeMove; // can be turned off by user setting
  500. RECT _rcSizeMoveIgnore;
  501. // event to tell the services on NT5 that we are done with boot
  502. // and they can do their stuff
  503. HANDLE _hShellReadyEvent;
  504. // BOGUS: nuke this (multiple monitors...)
  505. HWND _aHwndAutoHide[ABE_MAX];
  506. // Users and Passwords must send this message to get the "real" logged on user to log off.
  507. // This is required since sometimes U&P runs in the context of a different user and logging this
  508. // other user off does no good. See ext\netplwiz for the other half of this...-dsheldon.
  509. UINT _uLogoffUser;
  510. UINT _uStartButtonBalloonTip;
  511. UINT _uWinMM_DeviceChange;
  512. BOOL _fEarlyStartupFailure;
  513. BOOL _fStartupTroubleshooterLaunched;
  514. ULONG _uNotify;
  515. BOOL _fUseChangeNotifyTimer, _fChangeNotifyTimerRunning;
  516. BOOL _fIsDesktopLocked;
  517. BOOL _fIsDesktopConnected;
  518. // These member variables are used to keep track of downlevel apps
  519. // which attempt to take over as default web browser
  520. HKEY _hkHTTP;
  521. HANDLE _hHTTPEvent;
  522. HANDLE _hHTTPWait;
  523. friend class CDeskTray;
  524. friend class CStartDropTarget;
  525. friend class CTrayDropTarget;
  526. friend class CDropTargetBase;
  527. friend void Tray_OnStartMenuDismissed();
  528. friend void Tray_SetStartPaneActive(BOOL fActive);
  529. friend void Tray_DoProperties(DWORD dwFlags);
  530. };
  531. extern CTray c_tray;
  532. extern BOOL g_fInSizeMove;
  533. extern UINT g_uStartButtonAllowPopup;
  534. BOOL _IsSizeMoveEnabled();
  535. BOOL _IsSizeMoveRestricted();
  536. #endif // __cplusplus
  537. #endif // _TRAY_H