Author: dquintana
Date: Fri May 2 11:58:07 2014
New Revision: 63103
URL:
http://svn.reactos.org/svn/reactos?rev=63103&view=rev
Log:
[RSHELL]
* I forgot a cast and a couple IID_PPV_ARG uncommited.
[BROWSEUI]
* Fixed rebar flags to match windows. Adds the missing border around the toolbars.
* Fix some calculations of the rebar size.
* Fetch the icon of the current folder and assign it to the browse window.
CORE-7330
Modified:
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Fri May 2
11:58:07 2014
@@ -1341,7 +1341,7 @@
pidl = ILClone(m_idList);
if (!pidl)
{
- (*(IUnknown**) ppv)->Release();
+ (*reinterpret_cast<IUnknown**>(ppv))->Release();
return E_FAIL;
}
}
Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Fri May 2
11:58:07 2014
@@ -313,11 +313,11 @@
/* CLSID_MergedFolder 26fdc864-be88-46e7-9235-032d8ea5162e */
/* IID_IAugmentedShellFolder2 8db3b3f4-6cfe-11d1-8ae9-00c04fd918d0 */
hr = SHGetFolderLocation(NULL, CSIDL_STARTMENU, 0, 0, &pidlStartMenuUser);
- hr = shellFolder->BindToObject(pidlStartMenuUser, NULL, IID_IShellFolder, (void**)
&psfStartMenuUser);
+ hr = shellFolder->BindToObject(pidlStartMenuUser, NULL, IID_PPV_ARG(IShellFolder,
&psfStartMenuUser));
#if MERGE_FOLDERS
hr = SHGetFolderLocation(NULL, CSIDL_COMMON_STARTMENU, 0, 0, &pidlStartMenuAll);
- hr = shellFolder->BindToObject(pidlStartMenuAll, NULL, IID_IShellFolder, (void**)
&psfStartMenuAll);
+ hr = shellFolder->BindToObject(pidlStartMenuAll, NULL, IID_PPV_ARG(IShellFolder,
&psfStartMenuAll));
IShellFolder * psfMerged;
hr = CMergedFolder_Constructor(psfStartMenuUser, psfStartMenuAll,
IID_PPV_ARG(IShellFolder, &psfMerged));
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] Fri May
2 11:58:07 2014
@@ -528,6 +528,9 @@
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)
@@ -1095,7 +1098,6 @@
HWND ownerWindow;
HWND dockContainer;
HRESULT hResult;
- DWORD style;
if (pUnkSite == NULL)
{
@@ -1125,9 +1127,11 @@
SubclassWindow(dockContainer);
// create rebar in dock container
- style = WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | RBS_VARHEIGHT
|
- RBS_BANDBORDERS | RBS_REGISTERDROP | RBS_AUTOSIZE | CCS_NODIVIDER |
CCS_NOPARENTALIGN | CCS_TOP;
- fMainReBar = CreateWindow(REBARCLASSNAMEW, NULL, style,
+ DWORD style = WS_VISIBLE | WS_BORDER | WS_CHILD | WS_CLIPSIBLINGS |
WS_CLIPCHILDREN |
+ RBS_VARHEIGHT | RBS_BANDBORDERS | RBS_REGISTERDROP | RBS_AUTOSIZE |
RBS_DBLCLKTOGGLE |
+ CCS_NODIVIDER | CCS_NOPARENTALIGN | CCS_TOP;
+ DWORD exStyle = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR |
WS_EX_TOOLWINDOW;
+ fMainReBar = CreateWindowEx(exStyle, REBARCLASSNAMEW, NULL, style,
0, 0, 700, 60, dockContainer, NULL,
_AtlBaseModule.GetModuleInstance(), NULL);
if (fMainReBar == NULL)
return E_FAIL;
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] Fri May 2
11:58:07 2014
@@ -22,6 +22,12 @@
#include <shellapi.h>
#include <htiframe.h>
+
+extern "C"
+BOOL WINAPI Shell_GetImageLists(
+ _In_ HIMAGELIST *phiml,
+ _In_ HIMAGELIST *phimlSmall
+ );
#include "newatlinterfaces.h"
@@ -708,8 +714,7 @@
fCurrentDirectoryPIDL = NULL;
fStatusBar = NULL;
fStatusBarVisible = true;
- for (INT x = 0; x < 3; x++)
- fClientBars[x].hwnd = NULL;
+ memset(fClientBars, 0, sizeof(fClientBars));
fCurrentMenuBar = NULL;
fHistoryObject = NULL;
fHistoryStream = NULL;
@@ -920,7 +925,6 @@
HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
LPCITEMIDLIST absolutePIDL, FOLDERSETTINGS *folderSettings, long flags)
{
- CComPtr<IOleCommandTarget> oleCommandTarget;
CComPtr<IObjectWithSite> objectWithSite;
CComPtr<IShellFolder> saveCurrentShellFolder;
CComPtr<IShellView> saveCurrentShellView;
@@ -1006,10 +1010,6 @@
saveCurrentShellView->DestroyViewWindow();
fCurrentShellViewWindow = newShellViewWindow;
- // get command target
- oleCommandTarget.Release();
- hResult = newShellView->QueryInterface(IID_PPV_ARG(IOleCommandTarget,
&oleCommandTarget));
-
// no use
saveCurrentShellView.Release();
saveCurrentShellFolder.Release();
@@ -1029,7 +1029,18 @@
}
// completed
- FireNavigateComplete(L"c:\\temp"); // TODO: use real path here
+ nameFlags = SHGDN_FORADDRESSBAR | SHGDN_FORPARSING;
+ hResult = IEGetNameAndFlags(fCurrentDirectoryPIDL, nameFlags, newTitle,
+ sizeof(newTitle) / sizeof(wchar_t), NULL);
+ if (SUCCEEDED(hResult))
+ {
+ FireNavigateComplete(newTitle);
+ }
+ else
+ {
+ FireNavigateComplete(L"ERROR");
+ }
+
if (fCabinetState.fFullPathTitle)
nameFlags = SHGDN_FORADDRESSBAR | SHGDN_FORPARSING;
else
@@ -1037,7 +1048,26 @@
hResult = IEGetNameAndFlags(fCurrentDirectoryPIDL, nameFlags, newTitle,
sizeof(newTitle) / sizeof(wchar_t), NULL);
if (SUCCEEDED(hResult))
+ {
SetWindowText(newTitle);
+
+ LPCITEMIDLIST pidlChild;
+ INT index, indexOpen;
+ HIMAGELIST himlSmall, himlLarge;
+
+ CComPtr<IShellFolder> sf;
+ SHBindToParent(absolutePIDL, IID_PPV_ARG(IShellFolder, &sf),
&pidlChild);
+
+ index = SHMapPIDLToSystemImageListIndex(sf, pidlChild, &indexOpen);
+
+ Shell_GetImageLists(&himlSmall, &himlLarge);
+
+ HICON icSmall = ImageList_GetIcon(himlSmall, indexOpen, 0);
+ HICON icLarge = ImageList_GetIcon(himlLarge, indexOpen, 0);
+
+ SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icSmall));
+ SendMessage(WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(icLarge));
+ }
// TODO: Update the window icon
@@ -1303,7 +1333,6 @@
{
RECT clientRect;
RECT statusRect;
- RECT toolbarRect;
int x;
GetClientRect(&clientRect);
@@ -1319,28 +1348,39 @@
for (x = 0; x < 3; x++)
{
- if (fClientBars[x].hwnd == NULL && fClientBars[x].clientBar != NULL)
+ HWND hwnd = fClientBars[x].hwnd;
+ RECT borderSpace = fClientBars[x].borderSpace;
+ if (hwnd == NULL && fClientBars[x].clientBar != NULL)
{
- IUnknown_GetWindow(fClientBars[x].clientBar, &fClientBars[x].hwnd);
+ IUnknown_GetWindow(fClientBars[x].clientBar, &hwnd);
+ fClientBars[x].hwnd = hwnd;
}
- if (fClientBars[x].hwnd != NULL)
+ if (hwnd != NULL)
{
- toolbarRect = clientRect;
- if (fClientBars[x].borderSpace.top != 0)
- toolbarRect.bottom = toolbarRect.top + fClientBars[x].borderSpace.top;
- else if (fClientBars[x].borderSpace.bottom != 0)
- toolbarRect.top = toolbarRect.bottom -
fClientBars[x].borderSpace.bottom;
- if (fClientBars[x].borderSpace.left != 0)
- toolbarRect.right = toolbarRect.left + fClientBars[x].borderSpace.left;
- else if (fClientBars[x].borderSpace.right != 0)
- toolbarRect.left = toolbarRect.right - fClientBars[x].borderSpace.right;
- ::SetWindowPos(fClientBars[x].hwnd, NULL, toolbarRect.left, toolbarRect.top,
+ RECT toolbarRect = clientRect;
+ 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)
+ {
+ 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);
- clientRect.top += fClientBars[x].borderSpace.top;
- clientRect.left += fClientBars[x].borderSpace.left;
- clientRect.bottom += fClientBars[x].borderSpace.bottom;
- clientRect.right += fClientBars[x].borderSpace.right;
}
}
::SetWindowPos(fCurrentShellViewWindow, NULL, clientRect.left, clientRect.top,