mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[RSHELL]
[STOBJECT] * Some nitpicking. [SHELL32] * Fix missing null-termination by using proper string literals. svn path=/branches/shell-experiments/; revision=65194
This commit is contained in:
parent
3b5e160482
commit
3da5418d3f
6 changed files with 71 additions and 14 deletions
|
@ -26,10 +26,8 @@ BOOL WINAPI SetShellWindowEx(HWND, HWND);
|
|||
|
||||
#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 @@ HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk)
|
|||
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));
|
||||
|
|
|
@ -85,13 +85,20 @@ private:
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -194,6 +194,7 @@ BOOL CSysTray::ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
|
|||
UpdateIcons();
|
||||
return TRUE;
|
||||
case WM_DESTROY:
|
||||
KillTimer(1);
|
||||
ShutdownIcons();
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -26,10 +26,8 @@ BOOL WINAPI SetShellWindowEx(HWND, HWND);
|
|||
|
||||
#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 @@ HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk)
|
|||
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);
|
||||
|
|
|
@ -823,6 +823,29 @@ HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv)
|
|||
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 @@ HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4
|
|||
|
||||
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 */
|
||||
|
|
|
@ -696,6 +696,10 @@ public: \
|
|||
{ \
|
||||
case 0:
|
||||
|
||||
#define ALT_MSG_MAP(map) \
|
||||
break; \
|
||||
case map:
|
||||
|
||||
#define END_MSG_MAP() \
|
||||
break; \
|
||||
default: \
|
||||
|
|
Loading…
Reference in a new issue