Author: hbelusca
Date: Mon Jun 13 20:27:57 2016
New Revision: 71635
URL:
http://svn.reactos.org/svn/reactos?rev=71635&view=rev
Log:
[SHELL32]
- Use similar shell def-view window styles as on Windows.
- Add a "hack" to force the shell progman desktop window to get its correct
window name, when running our shell on Windows. I don't know why calling
CreateWindowExW(WS_EX_TOOLWINDOW, szProgmanClassName, szProgmanWindowName, ...) with a
valid szProgmanWindowName string still persists in setting the window name to NULL... If
someone has an idea, please let me know!
- Addendum to CORE-11375: Create the shell desktop view with the same size as the current
desktop's workarea. Confirmed with ApiMonitor on Windows. I add some "FIXME"
to make future developers think about possible improvements in the code.
Modified:
trunk/reactos/dll/win32/shell32/CDefView.cpp
trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] Mon Jun 13 20:27:57 2016
@@ -271,7 +271,7 @@
{
static ATL::CWndClassInfo wc =
{
- { sizeof(WNDCLASSEX), 0, StartWindowProc,
+ { sizeof(WNDCLASSEX), CS_PARENTDC, StartWindowProc,
0, 0, NULL, NULL,
LoadCursor(NULL, IDC_ARROW), (HBRUSH)(COLOR_WINDOW + 1), NULL,
SV_CLASS_NAME, NULL
},
@@ -2145,7 +2145,7 @@
TRACE("-- CommDlgBrowser\n");
}
- Create(m_hWndParent, prcView, NULL, WS_CHILD | WS_TABSTOP, 0, 0U);
+ Create(m_hWndParent, prcView, NULL, WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
WS_TABSTOP, 0, 0U);
if (m_hWnd == NULL)
return E_FAIL;
Modified: trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shelldes…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp [iso-8859-1]
(original)
+++ trunk/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp [iso-8859-1] Mon Jun
13 20:27:57 2016
@@ -194,17 +194,28 @@
BOOL CDesktopBrowser::CreateDeskWnd()
{
FOLDERSETTINGS fs;
- RECT rcClient;
+ RECT rcWorkArea;
HRESULT hRet;
- if (!GetClientRect(hWnd, &rcClient))
- {
- return FALSE;
- }
+ // FIXME: Add support for multi-monitor?
+ SystemParametersInfoW(SPI_GETWORKAREA,
+ 0, &rcWorkArea, 0);
+
+ // TODO: Call GetClientRect for the tray window and make small computation
+ // to be sure the tray window rect is removed from the work area!
+#if 0
+ RECT rcTray;
+ HWND hWndTray;
+
+ /* Get client rect of the taskbar */
+ hRet = ShellDesk->GetTrayWindow(&hWndTray);
+ if (SUCCEEDED(hRet))
+ GetClientRect(hWndTray, &rcTray);
+#endif
fs.ViewMode = FVM_ICON;
fs.fFlags = FWF_DESKTOP | FWF_NOCLIENTEDGE | FWF_NOSCROLL | FWF_TRANSPARENT;
- hRet = DesktopView->CreateViewWindow(NULL, &fs, (IShellBrowser *)this,
&rcClient, &hWndShellView);
+ hRet = DesktopView->CreateViewWindow(NULL, &fs, (IShellBrowser *)this,
&rcWorkArea, &hWndShellView);
if (!SUCCEEDED(hRet))
return FALSE;
@@ -491,6 +502,8 @@
RECT rcWorkArea;
// FIXME: Add support for multi-monitor!
+ // FIXME: Maybe merge with the code that retrieves the
+ // work area in CDesktopBrowser::CreateDeskWnd ?
SystemParametersInfoW(SPI_GETWORKAREA,
0, &rcWorkArea, 0);
@@ -518,6 +531,15 @@
case WM_NCCREATE:
{
LPCREATESTRUCT CreateStruct = (LPCREATESTRUCT)lParam;
+
+ // FIXME: This is a "hack" to enforce the window title
+ // to be set to what it should be *on Windows* only.
+ // I don't understand why it is reset to NULL whereas
+ // the creation of the progman window proper is done in
+ // the standard way... (05/06/2016, hbelusca).
+ //
+ ::SetWindowTextW(hwnd, CreateStruct->lpszName);
+
pThis = SHDESK_Create(hwnd, CreateStruct);
if (pThis == NULL)
{
@@ -614,12 +636,18 @@
cy = GetSystemMetrics(SM_CYSCREEN);
}
- hWndDesk = CreateWindowExW(WS_EX_TOOLWINDOW, szProgmanClassName,
szProgmanWindowName,
- WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
+ hWndDesk = ::CreateWindowExW(WS_EX_TOOLWINDOW, szProgmanClassName,
szProgmanWindowName,
+ WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
x, y, cx, cy,
NULL, NULL, shell32_hInstance, (LPVOID)ShellDesk);
+
if (hWndDesk != NULL)
+ {
+ ::ShowWindow(hWndDesk, SW_SHOW);
+ ::UpdateWindow(hWndDesk);
+
return (HANDLE)GetWindowLongPtrW(hWndDesk, 0);
+ }
return NULL;
}