Author: dquintana
Date: Sun May 4 13:57:23 2014
New Revision: 63156
URL:
http://svn.reactos.org/svn/reactos?rev=63156&view=rev
Log:
[BROWSEUI]
* Begin implementing resizing of the rebar.
* Begin implementing the addressbar function. For now, the current folder path is
displayed. No icon, no parsing support, no combo dropdown list.
CORE-8173
Modified:
branches/shell-experiments/dll/win32/browseui/addressband.cpp
branches/shell-experiments/dll/win32/browseui/addressband.h
branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp
branches/shell-experiments/dll/win32/browseui/addresseditbox.h
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.h
branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
branches/shell-experiments/dll/win32/browseui/travellog.cpp
Modified: branches/shell-experiments/dll/win32/browseui/addressband.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] Sun May 4
13:57:23 2014
@@ -24,6 +24,8 @@
#include "precomp.h"
+HRESULT CreateAddressEditBox(REFIID riid, void **ppv);
+
/*
TODO:
****Add command handler for show/hide Go button to OnWinEvent
@@ -45,6 +47,7 @@
fGoButton = NULL;
fComboBox = NULL;
fGoButtonShown = false;
+ fAdviseCookie = 0;
}
CAddressBand::~CAddressBand()
@@ -97,6 +100,8 @@
HRESULT STDMETHODCALLTYPE CAddressBand::SetSite(IUnknown *pUnkSite)
{
+ CComPtr<IBrowserService> browserService;
+ CComPtr<IOleWindow> oleWindow;
CComPtr<IShellService> shellService;
CComPtr<IUnknown> offset34;
HWND parentWindow;
@@ -107,9 +112,14 @@
HINSTANCE shellInstance;
HRESULT hResult;
+ if (pUnkSite == NULL)
+ {
+ hResult = AtlUnadvise(fSite, DIID_DWebBrowserEvents, fAdviseCookie);
+ fSite.Release();
+ return S_OK;
+ }
+
fSite.Release();
- if (pUnkSite == NULL)
- return S_OK;
hResult = pUnkSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite, &fSite));
if (FAILED(hResult))
@@ -138,11 +148,16 @@
#if 1
hResult = CoCreateInstance(CLSID_AddressEditBox, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IAddressEditBox, &fAddressEditBox));
- if (FAILED(hResult))
- return hResult;
#else
- // instantiate new version
+ hResult = E_FAIL;
#endif
+ if (FAILED(hResult))
+ {
+ // instantiate new version
+ hResult = CreateAddressEditBox(IID_PPV_ARG(IAddressEditBox,
&fAddressEditBox));
+ if (FAILED(hResult))
+ return hResult;
+ }
hResult = fAddressEditBox->QueryInterface(IID_PPV_ARG(IShellService,
&shellService));
if (FAILED(hResult))
@@ -169,11 +184,21 @@
0, 0, 0, 0, m_hWnd, NULL, _AtlBaseModule.GetModuleInstance(), NULL);
SendMessage(fGoButton, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
SendMessage(fGoButton, TB_SETMAXTEXTROWS, 1, 0);
- SendMessage(fGoButton, TB_SETIMAGELIST, 0,
reinterpret_cast<LPARAM>(normalImagelist));
- SendMessage(fGoButton, TB_SETHOTIMAGELIST, 0,
reinterpret_cast<LPARAM>(hotImageList));
+ if (normalImagelist)
+ SendMessage(fGoButton, TB_SETIMAGELIST, 0,
reinterpret_cast<LPARAM>(normalImagelist));
+ if (hotImageList)
+ SendMessage(fGoButton, TB_SETHOTIMAGELIST, 0,
reinterpret_cast<LPARAM>(hotImageList));
SendMessage(fGoButton, TB_ADDSTRINGW,
reinterpret_cast<WPARAM>(_AtlBaseModule.GetResourceInstance()),
IDS_GOBUTTONLABEL);
SendMessage(fGoButton, TB_ADDBUTTONSW, 1, (LPARAM)&buttonInfo);
+
+ // take advice to watch events
+ hResult = IUnknown_QueryService(pUnkSite, SID_SShellBrowser,
IID_PPV_ARG(IBrowserService, &browserService));
+ if (SUCCEEDED(hResult))
+ {
+ if (SUCCEEDED(hResult))
+ hResult = AtlAdvise(browserService, static_cast<IDispatch *>(this),
DIID_DWebBrowserEvents, &fAdviseCookie);
+ }
return hResult;
}
@@ -379,12 +404,65 @@
return E_NOTIMPL;
}
+HRESULT STDMETHODCALLTYPE CAddressBand::GetTypeInfoCount(UINT *pctinfo)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CAddressBand::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo
**ppTInfo)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CAddressBand::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames,
UINT cNames,
+ LCID lcid, DISPID *rgDispId)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CAddressBand::Invoke(DISPID dispIdMember, REFIID riid, LCID
lcid, WORD wFlags,
+ DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
+{
+ CComPtr<IBrowserService> isb;
+ HRESULT hr;
+
+ if (pDispParams == NULL)
+ return E_INVALIDARG;
+
+ switch (dispIdMember)
+ {
+ case DISPID_NAVIGATECOMPLETE2:
+ case DISPID_DOCUMENTCOMPLETE:
+ hr = IUnknown_QueryService(fSite, SID_STopLevelBrowser,
IID_PPV_ARG(IBrowserService, &isb));
+ if (FAILED(hr))
+ return hr;
+ PIDLIST_ABSOLUTE absolutePIDL;
+ LPCITEMIDLIST pidlChild;
+ isb->GetPidl(&absolutePIDL);
+
+ CComPtr<IShellFolder> sf;
+ SHBindToParent(absolutePIDL, IID_PPV_ARG(IShellFolder, &sf),
&pidlChild);
+
+ STRRET ret;
+ sf->GetDisplayNameOf(pidlChild, SHGDN_FORADDRESSBAR | SHGDN_FORPARSING,
&ret);
+
+ WCHAR buf[4096];
+ StrRetToBufW(&ret, pidlChild, buf, 4095);
+
+ fAddressEditBox->SetCurrentDir(reinterpret_cast<long>(buf));
+
+ break;
+ }
+ return S_OK;
+}
+
LRESULT CAddressBand::OnNotifyClick(WPARAM wParam, NMHDR *notifyHeader, BOOL
&bHandled)
{
if (notifyHeader->hwndFrom == fGoButton)
{
- SendMessage(fEditControl, WM_KEYDOWN, 13, 0);
- SendMessage(fEditControl, WM_KEYUP, 13, 0);
+ fAddressEditBox->ParseNow(0);
+ //SendMessage(fEditControl, WM_KEYDOWN, 13, 0);
+ //SendMessage(fEditControl, WM_KEYUP, 13, 0);
}
return 0;
}
Modified: branches/shell-experiments/dll/win32/browseui/addressband.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addressband.h [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/addressband.h [iso-8859-1] Sun May 4
13:57:23 2014
@@ -32,7 +32,8 @@
public IServiceProvider,
public IWinEventHandler,
public IAddressBand,
- public IInputObjectSite
+ public IInputObjectSite,
+ public IDispatch
{
private:
CComPtr<IDockingWindowSite> fSite;
@@ -41,6 +42,7 @@
HWND fGoButton;
HWND fComboBox;
bool fGoButtonShown;
+ DWORD fAdviseCookie;
public:
CAddressBand();
~CAddressBand();
@@ -95,6 +97,12 @@
virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize);
+ // *** IDispatch methods ***
+ virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
+ virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo
**ppTInfo);
+ virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames,
UINT cNames, LCID lcid, DISPID *rgDispId);
+ virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT
*puArgErr);
+
// message handlers
LRESULT OnNotifyClick(WPARAM wParam, NMHDR *notifyHeader, BOOL &bHandled);
LRESULT OnTipText(UINT idControl, NMHDR *notifyHeader, BOOL &bHandled);
@@ -128,5 +136,6 @@
COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist)
COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
+ COM_INTERFACE_ENTRY_IID(IID_IDispatch, IDispatch)
END_COM_MAP()
};
Modified: branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] Sun May
4 13:57:23 2014
@@ -40,8 +40,7 @@
*/
CAddressEditBox::CAddressEditBox() :
- fEditWindow(NULL, this, 1),
- fComboBoxExWindow(NULL, this, 2)
+ fEditWindow(NULL, this, 1)
{
}
@@ -57,6 +56,8 @@
HRESULT STDMETHODCALLTYPE CAddressEditBox::FileSysChange(long param8, long paramC)
{
+ LPWSTR str8 = reinterpret_cast<LPWSTR>(param8);
+ LPWSTR strC = reinterpret_cast<LPWSTR>(paramC);
return E_NOTIMPL;
}
@@ -67,13 +68,15 @@
HRESULT STDMETHODCALLTYPE CAddressEditBox::Init(HWND comboboxEx, HWND editControl, long
param14, IUnknown *param18)
{
- fComboBoxExWindow.SubclassWindow(comboboxEx);
+ SubclassWindow(comboboxEx);
fEditWindow.SubclassWindow(editControl);
return S_OK;
}
HRESULT STDMETHODCALLTYPE CAddressEditBox::SetCurrentDir(long paramC)
{
+ LPWSTR strC = reinterpret_cast<LPWSTR>(paramC);
+ fEditWindow.SetWindowText(strC);
return E_NOTIMPL;
}
@@ -165,6 +168,25 @@
HRESULT STDMETHODCALLTYPE CAddressEditBox::GetSizeMax(ULARGE_INTEGER *pcbSize)
{
return E_NOTIMPL;
+}
+
+LRESULT CAddressEditBox::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ bHandled = FALSE;
+/*
+ RECT rc;
+ GetClientRect(&rc);
+ rc.left += 24;
+ rc.top += 4;
+ rc.right -= 4;
+ rc.bottom -= 4;
+ fEditWindow.SetWindowPos(NULL,
+ rc.left, rc.top,
+ rc.right - rc.left,
+ rc.bottom - rc.top,
+ SWP_NOOWNERZORDER | SWP_NOZORDER);
+*/
+ return 0;
}
HRESULT CreateAddressEditBox(REFIID riid, void **ppv)
Modified: branches/shell-experiments/dll/win32/browseui/addresseditbox.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addresseditbox.h [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/addresseditbox.h [iso-8859-1] Sun May 4
13:57:23 2014
@@ -34,7 +34,6 @@
{
private:
CContainedWindow fEditWindow;
- CContainedWindow fComboBoxExWindow;
public:
CAddressEditBox();
~CAddressEditBox();
@@ -80,6 +79,7 @@
// message handlers
// LRESULT OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
// LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+ LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
DECLARE_REGISTRY_RESOURCEID(IDR_ADDRESSEDITBOX)
DECLARE_NOT_AGGREGATABLE(CAddressEditBox)
@@ -94,6 +94,7 @@
// MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocusSaveButton)
// ALT_MSG_MAP(2)
// MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocusSelectButton)
+ MESSAGE_HANDLER(WM_SIZE, OnSize)
END_MSG_MAP()
BEGIN_COM_MAP(CAddressEditBox)
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Sun May
4 13:57:23 2014
@@ -24,6 +24,10 @@
*/
#include "precomp.h"
+
+/* FIXME, I can't include windowsx because it conflicts with some #defines */
+#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
+#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
#define USE_CUSTOM_MENUBAND 1
@@ -514,33 +518,24 @@
newSite->Initialize(newItem, this, fMainReBar, bandID, flags);
}
-HRESULT CInternetToolbar::ReserveBorderSpace()
+HRESULT CInternetToolbar::ReserveBorderSpace(LONG maxHeight)
{
CComPtr<IDockingWindowSite> dockingWindowSite;
RECT availableBorderSpace;
- RECT neededBorderSpace;
- HRESULT hResult;
-
- hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite,
&dockingWindowSite));
+
+ HRESULT hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite,
&dockingWindowSite));
if (FAILED(hResult))
return hResult;
hResult = dockingWindowSite->GetBorderDW(static_cast<IDockingWindow
*>(this), &availableBorderSpace);
if (FAILED(hResult))
return hResult;
- SendMessage(fMainReBar, RB_SIZETORECT, RBSTR_CHANGERECT,
reinterpret_cast<LPARAM>(&availableBorderSpace));
- // RBSTR_CHANGERECT does not seem to set the proper size in the rect.
- // Let's make sure we fetch the actual size properly.
- GetWindowRect(fMainReBar, &availableBorderSpace);
- neededBorderSpace.left = 0;
- neededBorderSpace.top = availableBorderSpace.bottom - availableBorderSpace.top;
- if (!fLocked)
- neededBorderSpace.top += 3;
- neededBorderSpace.right = 0;
- neededBorderSpace.bottom = 0;
- hResult = dockingWindowSite->SetBorderSpaceDW(static_cast<IDockingWindow
*>(this), &neededBorderSpace);
- if (FAILED(hResult))
- return hResult;
- return S_OK;
+
+ if (availableBorderSpace.top > maxHeight)
+ {
+ availableBorderSpace.top = maxHeight;
+ }
+
+ return ResizeBorderDW(&availableBorderSpace, fSite, FALSE);
}
HRESULT CInternetToolbar::CreateMenuBar(IShellMenu **menuBar)
@@ -784,7 +779,36 @@
HRESULT STDMETHODCALLTYPE CInternetToolbar::ResizeBorderDW(LPCRECT prcBorder,
IUnknown *punkToolbarSite, BOOL fReserved)
{
- return E_NOTIMPL;
+ RECT neededBorderSpace;
+ RECT availableBorderSpace = *prcBorder;
+
+ SendMessage(fMainReBar, RB_SIZETORECT, RBSTR_CHANGERECT,
reinterpret_cast<LPARAM>(&availableBorderSpace));
+
+ // RBSTR_CHANGERECT does not seem to set the proper size in the rect.
+ // Let's make sure we fetch the actual size properly.
+ GetWindowRect(fMainReBar, &availableBorderSpace);
+ neededBorderSpace.left = 0;
+ neededBorderSpace.top = availableBorderSpace.bottom - availableBorderSpace.top;
+ if (!fLocked)
+ neededBorderSpace.top += 3;
+ neededBorderSpace.right = 0;
+ neededBorderSpace.bottom = 0;
+
+ CComPtr<IDockingWindowSite> dockingWindowSite;
+
+ HRESULT hResult = fSite->QueryInterface(IID_PPV_ARG(IDockingWindowSite,
&dockingWindowSite));
+ if (FAILED(hResult))
+ return hResult;
+
+ hResult = dockingWindowSite->RequestBorderSpaceDW(static_cast<IDockingWindow
*>(this), &neededBorderSpace);
+ if (FAILED(hResult))
+ return hResult;
+
+ hResult = dockingWindowSite->SetBorderSpaceDW(static_cast<IDockingWindow
*>(this), &neededBorderSpace);
+ if (FAILED(hResult))
+ return hResult;
+
+ return S_OK;
}
HRESULT STDMETHODCALLTYPE CInternetToolbar::GetClassID(CLSID *pClassID)
@@ -830,8 +854,7 @@
hResult = CreateMenuBar(&menuBar);
if (FAILED(hResult))
return hResult;
- AddDockItem(menuBar, ITBBID_MENUBAND,
- CDockSite::ITF_NOTITLE | CDockSite::ITF_NEWBANDALWAYS |
CDockSite::ITF_GRIPPERALWAYS);
+ AddDockItem(menuBar, ITBBID_MENUBAND, CDockSite::ITF_NOTITLE |
CDockSite::ITF_NEWBANDALWAYS | CDockSite::ITF_GRIPPERALWAYS);
hResult = menuBar->QueryInterface(IID_PPV_ARG(IOleWindow, &menuOleWindow));
hResult = menuOleWindow->GetWindow(&fMenuBandWindow);
@@ -841,8 +864,7 @@
hResult = CreateBrandBand(&logoBar);
if (FAILED(hResult))
return hResult;
- AddDockItem(logoBar, ITBBID_BRANDBAND,
- CDockSite::ITF_NOGRIPPER | CDockSite::ITF_NOTITLE | CDockSite::ITF_FIXEDSIZE);
+ AddDockItem(logoBar, ITBBID_BRANDBAND, CDockSite::ITF_NOGRIPPER |
CDockSite::ITF_NOTITLE | CDockSite::ITF_FIXEDSIZE);
fLogoBar.Attach(logoBar.Detach()); // transfer the ref count
/* Create and attach the standard toolbar to the rebar */
@@ -1184,7 +1206,7 @@
if (fMenuBar)
{
hResult = fMenuBar->QueryInterface(IID_PPV_ARG(IWinEventHandler,
&menuWinEventHandler));
- if (menuWinEventHandler->IsWindowOwner(hWnd))
+ if (menuWinEventHandler->IsWindowOwner(hWnd) == S_OK)
{
return menuWinEventHandler->OnWinEvent(fMenuBandWindow, uMsg, wParam,
lParam, theResult);
}
@@ -1661,6 +1683,66 @@
return 0;
}
+LRESULT CInternetToolbar::OnLDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ bHandled = FALSE;
+ if (fLocked)
+ return 0;
+
+ if (wParam & MK_CONTROL)
+ return 0;
+
+ fSizing = TRUE;
+
+ DWORD msgp = GetMessagePos();
+
+ fStartPosition.x = GET_X_LPARAM(msgp);
+ fStartPosition.y = GET_Y_LPARAM(msgp);
+
+ RECT rc;
+ GetWindowRect(m_hWnd, &rc);
+
+ fStartHeight = rc.bottom - rc.top;
+
+ SetCapture();
+
+ bHandled = TRUE;
+ return 0;
+}
+
+LRESULT CInternetToolbar::OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ bHandled = FALSE;
+ if (!fSizing)
+ return 0;
+
+ DWORD msgp = GetMessagePos();
+
+ POINT pt;
+ pt.x = GET_X_LPARAM(msgp);
+ pt.y = GET_Y_LPARAM(msgp);
+
+ ReserveBorderSpace(fStartHeight - fStartPosition.y + pt.y);
+
+ bHandled = TRUE;
+ return 0;
+}
+
+LRESULT CInternetToolbar::OnLUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ bHandled = FALSE;
+ if (!fSizing)
+ return 0;
+
+ OnMouseMove(uMsg, wParam, lParam, bHandled);
+
+ fSizing = FALSE;
+
+ ReleaseCapture();
+
+ return 0;
+}
+
HRESULT CreateInternetToolbar(REFIID riid, void **ppv)
{
CComObject<CInternetToolbar> *theToolbar;
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.h [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.h [iso-8859-1] Sun May
4 13:57:23 2014
@@ -96,11 +96,14 @@
HWND fToolbarWindow;
DWORD fAdviseCookie;
CComPtr<IBandProxy> fBandProxy;
+ BOOL fSizing;
+ POINT fStartPosition;
+ LONG fStartHeight;
public:
CInternetToolbar();
~CInternetToolbar();
void AddDockItem(IUnknown *newItem, int bandID, int flags);
- HRESULT ReserveBorderSpace();
+ HRESULT ReserveBorderSpace(LONG maxHeight = -1);
HRESULT CreateMenuBar(IShellMenu **menuBar);
HRESULT CreateBrandBand(IUnknown **logoBar);
HRESULT CreateToolsBar(IUnknown **toolsBar);
@@ -198,6 +201,9 @@
LRESULT OnTipText(UINT idControl, NMHDR *pNMHDR, BOOL &bHandled);
LRESULT OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+ LRESULT OnLDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+ LRESULT OnLUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+ LRESULT OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
BEGIN_MSG_MAP(CInternetToolbar)
COMMAND_ID_HANDLER(gBackCommandID, OnTravelBack)
@@ -215,6 +221,9 @@
MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
NOTIFY_CODE_HANDLER(TTN_NEEDTEXTW, OnTipText)
MESSAGE_HANDLER(WM_NOTIFY, OnNotify)
+ MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLDown)
+ MESSAGE_HANDLER(WM_LBUTTONUP, OnLUp)
+ MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove)
END_MSG_MAP()
DECLARE_REGISTRY_RESOURCEID(IDR_INTERNETTOOLBAR)
Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Sun May 4
13:57:23 2014
@@ -25,8 +25,8 @@
extern "C"
BOOL WINAPI Shell_GetImageLists(
- _In_ HIMAGELIST *phiml,
- _In_ HIMAGELIST *phimlSmall
+ _Out_ HIMAGELIST *phiml,
+ _Out_ HIMAGELIST *phimlSmall
);
#include "newatlinterfaces.h"
@@ -200,8 +200,8 @@
{
CComPtr<IShellFolder> desktop;
- ::SHGetDesktopFolder(&desktop);
- if (desktop == NULL)
+ HRESULT hr = ::SHGetDesktopFolder(&desktop);
+ if (FAILED(hr))
return E_FAIL;
if (path == NULL || path->mkid.cb == 0)
{
@@ -1361,26 +1361,43 @@
if (borderSpace.top != 0)
{
toolbarRect.bottom = toolbarRect.top + borderSpace.top;
- clientRect.top += borderSpace.top;
}
else if (borderSpace.bottom != 0)
{
toolbarRect.top = toolbarRect.bottom - borderSpace.bottom;
- clientRect.bottom -= borderSpace.bottom;
}
- if (borderSpace.left != 0)
+ else if (borderSpace.left != 0)
{
toolbarRect.right = toolbarRect.left + borderSpace.left;
- clientRect.left += borderSpace.left;
}
else if (borderSpace.right != 0)
{
toolbarRect.left = toolbarRect.right - borderSpace.right;
- clientRect.right -= borderSpace.right;
}
- ::SetWindowPos(hwnd, NULL, toolbarRect.left, toolbarRect.top,
- toolbarRect.right - toolbarRect.left,
- toolbarRect.bottom - toolbarRect.top, SWP_NOOWNERZORDER |
SWP_NOZORDER);
+
+ ::SetWindowPos(hwnd, NULL,
+ toolbarRect.left,
+ toolbarRect.top,
+ toolbarRect.right - toolbarRect.left,
+ toolbarRect.bottom - toolbarRect.top,
+ SWP_NOOWNERZORDER | SWP_NOZORDER);
+
+ if (borderSpace.top != 0)
+ {
+ clientRect.top = toolbarRect.bottom;
+ }
+ else if (borderSpace.bottom != 0)
+ {
+ clientRect.bottom = toolbarRect.top;
+ }
+ else if (borderSpace.left != 0)
+ {
+ clientRect.left = toolbarRect.right;
+ }
+ else if (borderSpace.right != 0)
+ {
+ clientRect.right = toolbarRect.left;
+ }
}
}
::SetWindowPos(fCurrentShellViewWindow, NULL, clientRect.left, clientRect.top,
@@ -1589,8 +1606,9 @@
HRESULT STDMETHODCALLTYPE CShellBrowser::GetBorderDW(IUnknown *punkObj, LPRECT
prcBorder)
{
- RECT availableBounds;
- static const INT excludeItems[] = {1, 1, 1, 0xa001, 0, 0};
+ static const INT excludeItems[] = { 1, 1, 1, 0xa001, 0, 0 };
+
+ RECT availableBounds;
GetEffectiveClientRect(m_hWnd, &availableBounds, excludeItems);
for (INT x = 0; x < 3; x++)
@@ -1853,6 +1871,15 @@
HRESULT STDMETHODCALLTYPE CShellBrowser::SetStatusTextSB(LPCOLESTR pszStatusText)
{
+ //
+ if (pszStatusText)
+ {
+ ::SetWindowText(fStatusBar, pszStatusText);
+ }
+ else
+ {
+
+ }
return E_NOTIMPL;
}
@@ -2041,8 +2068,10 @@
HRESULT hResult;
// called by toolbar when displaying tooltips
- if (pptl != NULL)
- *pptl = NULL;
+ if (pptl == NULL)
+ return E_FAIL;
+
+ *pptl = NULL;
if (fTravelLog.p == NULL)
{
hResult = CreateTravelLog(IID_PPV_ARG(ITravelLog, &fTravelLog));
Modified: branches/shell-experiments/dll/win32/browseui/travellog.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/travellog.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/travellog.cpp [iso-8859-1] Sun May 4
13:57:23 2014
@@ -125,7 +125,7 @@
{
HRESULT hResult;
- hResult = ILGetDisplayNameEx(NULL, fPIDL, pwzText, ILGDN_NORMAL);
+ hResult = ILGetDisplayNameEx(NULL, fPIDL, pwzText, ILGDN_NORMAL) ? S_OK : S_FALSE;
if (FAILED(hResult))
return hResult;
return S_OK;