5#define PROXY_DESKTOP_CLASS L"Proxy Desktop"
34 public CWindowImpl < CProxyDesktop, CWindow, CFrameWinTraits >
48 TRACE(
"Proxy Desktop message 1037.\n");
55 TRACE(
"Proxy Desktop message 1035 received.\n");
82 TRACE(
"Found main desktop.\n");
88 TRACE(
"Separate folders setting enabled. Ignoring main desktop.\n");
95 TRACE(
"Found proxy desktop.\n");
105 UINT sharedBlockSize =
sizeof(*hnfData);
106 UINT directoryPidlLength = 0;
118 sharedBlockSize += directoryPidlLength;
119 TRACE(
"directoryPidlLength=%d\n", directoryPidlLength);
126 sharedBlockSize += pidlSize7C;
127 TRACE(
"pidlSize7C=%d\n", pidlSize7C);
131 if (!(threadParams->
offset84 & 0x8000))
136 sharedBlockSize += pidlSize80;
137 TRACE(
"pidlSize80=%d\n", pidlSize7C);
142 TRACE(
"pidl80 sent by value = %p\n", pidl80);
144 sharedBlockSize += pidlSize80;
150 pathLength = 2 *
lstrlenW(strPath) + 2;
151 sharedBlockSize += pathLength;
152 TRACE(
"pathLength=%d\n", pidlSize7C);
155 TRACE(
"sharedBlockSize=%d\n", sharedBlockSize);
161 ERR(
"Shared section alloc error.\n");
175 hnfData->
cbSize = sharedBlockSize;
192 target +=
sizeof(*hnfData);
198 target += directoryPidlLength;
211 if (threadParams->
offset84 & 0x8000)
273 block +=
sizeof(*hnfData);
279 params->directoryPIDL = pidl;
296 if (!(
params->offset84 & 0x8000))
334 if (!
params->directoryPIDL)
357 wFlags |= SBSP_EXPLOREMODE;
383 pbs->SetFlags(BSF_UISETBYAUTOMATION, BSF_UISETBYAUTOMATION);
390 if (pidlSelect !=
NULL)
393 hResult = psb->QueryActiveShellView(&shellView);
396 shellView->SelectItem(pidlSelect, SVSI_SELECT | SVSI_FOCUSED | SVSI_ENSUREVISIBLE);
419 if (browser->v_MayTranslateAccelerator(&
Msg) !=
S_OK)
426 ReleaseCComPtrExpectZero(browser);
462 TRACE(
"SHCreateIETHREADPARAM\n");
469 result->offsetC = param10;
472 result->offset14 = param14;
485 TRACE(
"SHCloneIETHREADPARAM\n");
498 result->offset70->AddRef();
501 result->offsetC->Method2C();
511 TRACE(
"SHDestroyIETHREADPARAM\n");
522 param->offset14->Release();
524 param->offset70->Release();
526 param->offset78->Release();
528 param->offsetC->Release();
530 param->pExplorerInstance->Release();
539 TRACE(
"SHOnCWMCommandLine\n");
575 if (threadHandle !=
NULL)
595 TRACE(
"SHOpenNewFrame\n");
598 if (parameters ==
NULL)
621 TRACE(
"SHCreateFromDesktop\n");
630 if (parseResults->pidlPath)
632 WARN(
"strPath and pidlPath are both assigned. This shouldn't happen.\n");
635 strPath = parseResults->strPath;
638 parameters->
dwFlags = parseResults->dwFlags;
639 parameters->
offset8 = parseResults->nCmdShow;
644 if (parseResults->strPath && parseResults->strPath[0])
666 TRACE(
"Found desktop hwnd=%p\n", desktop);
676 TRACE(
"Sending open message...\n");
685 TRACE(
"Desktop not found or separate flag requested.\n");
HRESULT WINAPI SHGetDesktopFolder(IShellFolder **psf)
void shell(int argc, const char *argv[])
HRESULT CShellBrowser_CreateInstance(REFIID riid, void **ppv)
#define SH_EXPLORER_CMDLINE_FLAG_EMBED
#define WM_EXPLORER_OPEN_NEW_WINDOW
#define SH_EXPLORER_CMDLINE_FLAG_STRING
#define SH_EXPLORER_CMDLINE_FLAG_NOREUSE
#define SH_EXPLORER_CMDLINE_FLAG_SEPARATE
#define SH_EXPLORER_CMDLINE_FLAG_E
#define SH_EXPLORER_CMDLINE_FLAG_SELECT
LRESULT OnMessage1037(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
CProxyDesktop(IEThreadParamBlock *parameters)
LRESULT OnOpenNewWindow(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
PIE_THREAD_PARAM_BLOCK ParseSharedPacket(HANDLE hData)
static DWORD WINAPI BrowserThreadProc(LPVOID lpThreadParameter)
HRESULT WINAPI SHOpenNewFrame(LPITEMIDLIST pidl, IUnknown *paramC, long param10, DWORD dwFlags)
HWND FindShellProxy(LPITEMIDLIST pidl)
BOOL WINAPI SHCreateFromDesktop(_In_ PEXPLORER_CMDLINE_PARSE_RESULTS parseResults)
HRESULT WINAPI SHOpenFolderWindow(PIE_THREAD_PARAM_BLOCK parameters)
#define PROXY_DESKTOP_CLASS
IEThreadParamBlock *WINAPI SHCreateIETHREADPARAM(long param8, long paramC, IUnknown *param10, IUnknown *param14)
BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo)
IEThreadParamBlock *WINAPI SHCloneIETHREADPARAM(IEThreadParamBlock *param)
static HRESULT ExplorerMessageLoop(IEThreadParamBlock *parameters)
void WINAPI SHDestroyIETHREADPARAM(IEThreadParamBlock *param)
HANDLE MakeSharedPacket(IEThreadParamBlock *threadParams, LPCWSTR strPath, int dwProcessId)
#define FAILED_UNEXPECTEDLY(hr)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
HRESULT WINAPI SHGetFolderLocation(HWND hwndOwner, int nFolder, HANDLE hToken, DWORD dwReserved, LPITEMIDLIST *ppidl)
HANDLE WINAPI SHAllocShared(LPCVOID lpvData, DWORD dwSize, DWORD dwProcId)
PVOID WINAPI SHLockShared(HANDLE hShared, DWORD dwProcId)
BOOL WINAPI SHFreeShared(HANDLE hShared, DWORD dwProcId)
BOOL WINAPI SHUnlockShared(LPVOID lpView)
HRESULT WINAPI SHCreateThreadRef(LONG *lprefcount, IUnknown **lppUnknown)
GLenum const GLfloat * params
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define MESSAGE_HANDLER(msg, func)
#define BEGIN_MSG_MAP(theClass)
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
#define memcpy(s1, s2, n)
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
void WINAPI ILFree(LPITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
BOOL WINAPI ILRemoveLastID(LPITEMIDLIST pidl)
BOOL WINAPI ILGetDisplayName(LPCITEMIDLIST pidl, LPVOID path)
LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl)
LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path)
HRESULT WINAPI SHGetInstanceExplorer(IUnknown **lpUnknown)
VOID WINAPI SHSetInstanceExplorer(LPUNKNOWN lpUnknown)
ITEMIDLIST UNALIGNED * LPITEMIDLIST
ITEMID_CHILD UNALIGNED * PUITEMID_CHILD
IUnknown * pExplorerInstance
LPITEMIDLIST directoryPIDL
TW_UINT32 TW_UINT16 TW_UINT16 MSG
HWND WINAPI GetShellWindow(VOID)
BOOL WINAPI AllowSetForegroundWindow(DWORD dwProcessId)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentProcessId(void)
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
_In_ DWORD _Out_ _In_ WORD wFlags
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IID_PPV_ARG(Itype, ppType)
static unsigned int block