Author: dquintana
Date: Sun Nov 2 20:17:23 2014
New Revision: 65194
URL:
http://svn.reactos.org/svn/reactos?rev=65194&view=rev
Log:
[RSHELL]
[STOBJECT]
* Some nitpicking.
[SHELL32]
* Fix missing null-termination by using proper string literals.
Modified:
branches/shell-experiments/base/shell/rshell/CDesktopBrowser.cpp
branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
branches/shell-experiments/dll/shellext/stobject/csystray.cpp
branches/shell-experiments/dll/win32/shell32/desktop.cpp
branches/shell-experiments/include/reactos/undocshell.h
branches/shell-experiments/lib/atl/atlwin.h
Modified: branches/shell-experiments/base/shell/rshell/CDesktopBrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CDesktopBrowser.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CDesktopBrowser.cpp [iso-8859-1] Sun Nov
2 20:17:23 2014
@@ -26,10 +26,8 @@
#define SHDESK_TAG 0x4b534544
-static const WCHAR szProgmanClassName [] = { 'P', 'r', 'o',
'g', 'm', 'a', 'n' };
-static const WCHAR szProgmanWindowName [] = {
- 'P', 'r', 'o', 'g', 'r', 'a',
'm', ' ', 'M', 'a', 'n', 'a', 'g',
'e', 'r'
-};
+static const WCHAR szProgmanClassName [] = L"Progman";
+static const WCHAR szProgmanWindowName [] = L"Program Manager";
class CDesktopBrowser :
public CComObjectRootEx<CComMultiThreadModelNoCS>,
@@ -542,7 +540,7 @@
rcDesk.bottom = GetSystemMetrics(SM_CYSCREEN);
}
- hWndDesk = CreateWindowExW(0, szProgmanClassName, szProgmanWindowName,
+ hWndDesk = CreateWindowExW(WS_EX_TOOLWINDOW, szProgmanClassName,
szProgmanWindowName,
WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
rcDesk.left, rcDesk.top, rcDesk.right, rcDesk.bottom,
NULL, NULL, shell32_hInstance, reinterpret_cast<LPVOID>(ShellDesk));
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] Sun Nov 2
20:17:23 2014
@@ -85,13 +85,20 @@
return S_OK;
hr = IUnknown_GetSite(m_pDeskBar, IID_PPV_ARG(ITrayPriv, &m_pTrayPriv));
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
hr = IUnknown_GetWindow(m_pTrayPriv, &m_hwndTray);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
hr = m_pTrayPriv->AppendMenuW(&hmenu);
-#ifndef TEST_TRACKPOPUPMENU_SUBMENUS
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
hr = m_pShellMenu->SetMenu(hmenu, NULL, SMSET_BOTTOM);
-#else
- hr = m_pShellMenu->SetMenu(hmenu, m_hwndTray, SMSET_BOTTOM);
-#endif
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
return hr;
}
Modified: branches/shell-experiments/dll/shellext/stobject/csystray.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/shellext/…
==============================================================================
--- branches/shell-experiments/dll/shellext/stobject/csystray.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/shellext/stobject/csystray.cpp [iso-8859-1] Sun Nov 2
20:17:23 2014
@@ -194,6 +194,7 @@
UpdateIcons();
return TRUE;
case WM_DESTROY:
+ KillTimer(1);
ShutdownIcons();
return TRUE;
}
Modified: branches/shell-experiments/dll/win32/shell32/desktop.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/desktop.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/desktop.cpp [iso-8859-1] Sun Nov 2
20:17:23 2014
@@ -26,10 +26,8 @@
#define SHDESK_TAG 0x4b534544
-static const WCHAR szProgmanClassName[] =
{'P','r','o','g','m','a','n'};
-static const WCHAR szProgmanWindowName[] = {
-
'P','r','o','g','r','a','m','
','M','a','n','a','g','e','r'
-};
+static const WCHAR szProgmanClassName [] = L"Progman";
+static const WCHAR szProgmanWindowName [] = L"Program Manager";
class CDesktopBrowser :
public CComObjectRootEx<CComMultiThreadModelNoCS>,
@@ -543,7 +541,7 @@
rcDesk.bottom = GetSystemMetrics(SM_CYSCREEN);
}
- hWndDesk = CreateWindowExW(0, szProgmanClassName, szProgmanWindowName,
+ hWndDesk = CreateWindowExW(WS_EX_TOOLWINDOW, szProgmanClassName,
szProgmanWindowName,
WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
rcDesk.left, rcDesk.top, rcDesk.right, rcDesk.bottom,
NULL, NULL, shell32_hInstance, (LPVOID)ShellDesk);
Modified: branches/shell-experiments/include/reactos/undocshell.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/react…
==============================================================================
--- branches/shell-experiments/include/reactos/undocshell.h [iso-8859-1] (original)
+++ branches/shell-experiments/include/reactos/undocshell.h [iso-8859-1] Sun Nov 2
20:17:23 2014
@@ -823,6 +823,29 @@
return S_OK;
}
+template<class T, class T1>
+HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, void ** ppv)
+{
+ CComPtr<T> obj;
+ HRESULT hResult;
+
+ if (ppv == NULL)
+ return E_POINTER;
+ *ppv = NULL;
+ ATLTRY(obj = new _CComObject<T>);
+ if (obj.p == NULL)
+ return E_OUTOFMEMORY;
+ hResult = obj->QueryInterface(riid, ppv);
+ if (FAILED(hResult))
+ return hResult;
+
+ hResult = obj->Initialize(initArg1);
+ if (FAILED(hResult))
+ return hResult;
+
+ return S_OK;
+}
+
template<class T, class T1, class R>
HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv)
{
@@ -926,6 +949,32 @@
return S_OK;
}
+
+template<class T, class T1, class T2, class T3, class T4, class T5, class R>
+HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4,
T5 initArg5, REFIID riid, R ** ppv)
+{
+ CComPtr<T> obj;
+ CComPtr<R> result;
+ HRESULT hResult;
+
+ if (ppv == NULL)
+ return E_POINTER;
+ *ppv = NULL;
+ ATLTRY(obj = new _CComObject<T>);
+ if (obj.p == NULL)
+ return E_OUTOFMEMORY;
+ hResult = obj->QueryInterface(riid, reinterpret_cast<void
**>(&result));
+ if (FAILED(hResult))
+ return hResult;
+
+ hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4, initArg5);
+ if (FAILED(hResult))
+ return hResult;
+
+ *ppv = result.Detach();
+
+ return S_OK;
+}
#endif /* __cplusplus */
#endif /* __WINE_UNDOCSHELL_H */
Modified: branches/shell-experiments/lib/atl/atlwin.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/lib/atl/atlwi…
==============================================================================
--- branches/shell-experiments/lib/atl/atlwin.h [iso-8859-1] (original)
+++ branches/shell-experiments/lib/atl/atlwin.h [iso-8859-1] Sun Nov 2 20:17:23 2014
@@ -696,6 +696,10 @@
{ \
case 0:
+#define ALT_MSG_MAP(map) \
+ break; \
+ case map:
+
#define END_MSG_MAP() \
break; \
default: \