X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fbase%2Fshell%2Fexplorer%2Ftraywnd.cpp;h=a8bc029b9fe4866a2c5665a81fa5bd652fbaf15b;hp=68f4174ba9a31e3b0f10e259d33e0074dbf8c9b1;hb=b8b7eedce2afc8c1f3c3e6d8839a23276aab0f6c;hpb=0cd03197e21fbb263d5dd203a2e4e12e8f134deb diff --git a/reactos/base/shell/explorer/traywnd.cpp b/reactos/base/shell/explorer/traywnd.cpp index 68f4174ba9a..a8bc029b9fe 100644 --- a/reactos/base/shell/explorer/traywnd.cpp +++ b/reactos/base/shell/explorer/traywnd.cpp @@ -177,13 +177,15 @@ class CTrayWindow : public CComObjectRootEx, public CWindowImpl < CTrayWindow, CWindow, CControlWinTraits >, public ITrayWindow, - public IShellDesktopTray + public IShellDesktopTray, + public IOleWindow { CStartButton m_StartButton; CComPtr m_StartMenuBand; CComPtr m_StartMenuPopup; + CComPtr m_TaskBand; HTHEME m_Theme; HFONT m_Font; @@ -2079,6 +2081,8 @@ ChangePos: LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { + HRESULT hRet; + ((ITrayWindow*)this)->AddRef(); SetWindowTheme(m_hWnd, L"TaskBar", NULL); @@ -2093,8 +2097,26 @@ ChangePos: HBITMAP hbmBanner = LoadBitmapW(hExplorerInstance, MAKEINTRESOURCEW(IDB_STARTMENU)); m_StartMenuPopup = CreateStartMenu(this, &m_StartMenuBand, hbmBanner, 0); - /* Create the tray band site and its rebar */ - m_TrayBandSite = CreateTrayBandSite(this, &m_Rebar, &m_TaskSwitch); + /* Create the task band */ + hRet = CTaskBand_CreateInstance(this, IID_PPV_ARG(IDeskBand, &m_TaskBand)); + if (FAILED_UNEXPECTEDLY(hRet)) + return FALSE; + + /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */ + hRet = CTrayBandSite_CreateInstance(this, m_TaskBand, &m_TrayBandSite); + if (FAILED_UNEXPECTEDLY(hRet)) + return FALSE; + + /* Get the hwnd of the rebar */ + hRet = IUnknown_GetWindow(m_TrayBandSite, &m_Rebar); + if (FAILED_UNEXPECTEDLY(hRet)) + return FALSE; + + /* Get the hwnd of the tasks toolbar */ + hRet = IUnknown_GetWindow(m_TaskBand, &m_TaskSwitch); + if (FAILED_UNEXPECTEDLY(hRet)) + return FALSE; + SetWindowTheme(m_Rebar, L"TaskBar", NULL); /* Create the tray notification window */ @@ -2890,6 +2912,19 @@ HandleTrayContextMenu: return S_OK; } + HRESULT WINAPI GetWindow(HWND* phwnd) + { + if (!phwnd) + return E_INVALIDARG; + *phwnd = m_hWnd; + return S_OK; + } + + HRESULT WINAPI ContextSensitiveHelp(BOOL fEnterMode) + { + return E_NOTIMPL; + } + void _Init() { m_Position = (DWORD) -1; @@ -2901,6 +2936,7 @@ HandleTrayContextMenu: BEGIN_COM_MAP(CTrayWindow) /*COM_INTERFACE_ENTRY_IID(IID_ITrayWindow, ITrayWindow)*/ COM_INTERFACE_ENTRY_IID(IID_IShellDesktopTray, IShellDesktopTray) + COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IOleWindow) END_COM_MAP() };