* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <precomp.h>
+#include "precomp.h"
WINE_DEFAULT_DEBUG_CHANNEL(desktop);
#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>,
HWND hWndDesktopListView;
CComPtr<IShellDesktopTray> ShellDesk;
CComPtr<IShellView> DesktopView;
- IShellBrowser *DefaultShellBrowser;
+ CComPtr<IShellBrowser> DefaultShellBrowser;
LPITEMIDLIST pidlDesktopDirectory;
LPITEMIDLIST pidlDesktop;
public:
static CDesktopBrowser *SHDESK_Create(HWND hWnd, LPCREATESTRUCT lpCreateStruct)
{
- IShellDesktopTray *ShellDesk;
+ CComPtr<IShellDesktopTray> ShellDesk;
CComObject<CDesktopBrowser> *pThis;
HRESULT hRet;
HRESULT STDMETHODCALLTYPE CDesktopBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT wFlags)
{
- return E_NOTIMPL;
+ /*
+ * We should use IShellWindows interface here in order to attempt to
+ * find an open shell window that shows the requested pidl and activate it
+ */
+
+ return SHOpenNewFrame((LPITEMIDLIST)pidl, NULL, 0, 0);
}
HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetViewStateStream(DWORD grfMode, IStream **ppStrm)
if (uMsg != WM_NCCREATE)
{
- pThis = (CDesktopBrowser*)GetWindowLongPtrW(hwnd,
- 0);
+ pThis = reinterpret_cast<CDesktopBrowser *>(GetWindowLongPtrW(hwnd, 0));
if (pThis == NULL)
goto DefMsgHandler;
}
rcDesktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN);
/* FIXME: Update work area */
+ DBG_UNREFERENCED_LOCAL_VARIABLE(rcDesktop);
}
break;
break;
}
+ case WM_EXPLORER_OPEN_NEW_WINDOW:
+ DbgPrint("Proxy Desktop message 1035 received.\n");
+ SHOnCWMCommandLine((HANDLE)lParam);
+ break;
+
default:
DefMsgHandler:
Ret = DefWindowProcW(hwnd, uMsg, wParam, lParam);
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);
*/
BOOL WINAPI SHDesktopMessageLoop(HANDLE hDesktop)
{
- CDesktopBrowser *Desk = (CDesktopBrowser *)hDesktop;
+ CDesktopBrowser *Desk = static_cast<CDesktopBrowser *>(hDesktop);
if (Desk == NULL || Desk->Tag != SHDESK_TAG)
{