|
|
|
@ -2079,6 +2079,126 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (!strncmp(line + 1, "pin_tiles", 9)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
BOOL bFirst = TRUE; |
|
|
|
|
|
|
|
DWORD dwPermitOldStartTileData = TRUE; |
|
|
|
|
|
|
|
DWORD dwSize = sizeof(DWORD); |
|
|
|
|
|
|
|
RegSetKeyValueW(HKEY_CURRENT_USER, L"Software\\ExplorerPatcher", L"PermitOldStartTileDataOneShot", REG_DWORD, &dwPermitOldStartTileData, dwSize); |
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
LPCWSTR csPath = L"::{26EE0668-A00A-44D7-9371-BEB064C98683}"; |
|
|
|
|
|
|
|
SFGAOF stSFGAOFIn = 0; |
|
|
|
|
|
|
|
SFGAOF stSFGAOFOut = 0; |
|
|
|
|
|
|
|
SHParseDisplayName(csPath, NULL, &pidl, stSFGAOFIn, &stSFGAOFOut); |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
WCHAR wszOrigPath[MAX_PATH], wszCurPath[MAX_PATH]; |
|
|
|
|
|
|
|
IShellFolder* psfDesktop = NULL; |
|
|
|
|
|
|
|
hr = SHGetDesktopFolder(&psfDesktop); |
|
|
|
|
|
|
|
if (psfDesktop) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LPITEMIDLIST pidl; |
|
|
|
|
|
|
|
hr = SHGetFolderLocation(NULL, CSIDL_CONTROLS, (HANDLE)-1, 0, &pidl); |
|
|
|
|
|
|
|
if (pidl) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
STRRET strret; |
|
|
|
|
|
|
|
hr = psfDesktop->lpVtbl->GetDisplayNameOf(psfDesktop, pidl, SHGDN_FORPARSING, &strret); |
|
|
|
|
|
|
|
StrRetToBufW(&strret, pidl, wszOrigPath, MAX_PATH); |
|
|
|
|
|
|
|
SHOpenFolderAndSelectItems(pidl, 0, NULL, 0); |
|
|
|
|
|
|
|
VARIANT vt; |
|
|
|
|
|
|
|
HRESULT hr = E_FAIL; |
|
|
|
|
|
|
|
IShellWindows* pShellWindows = NULL; |
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_ShellWindows, NULL, CLSCTX_ALL, &IID_IShellWindows, &pShellWindows); |
|
|
|
|
|
|
|
if (pShellWindows) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
long k = 0; |
|
|
|
|
|
|
|
pShellWindows->lpVtbl->get_Count(pShellWindows, &k); |
|
|
|
|
|
|
|
for (int i = 0; i < k; ++i) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
vt.vt = VT_I4; |
|
|
|
|
|
|
|
vt.intVal = i; |
|
|
|
|
|
|
|
IDispatch* pDispatch = NULL; |
|
|
|
|
|
|
|
hr = pShellWindows->lpVtbl->Item(pShellWindows, vt, &pDispatch); |
|
|
|
|
|
|
|
if (pDispatch) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IWebBrowserApp* pWebBrowserApp = NULL; |
|
|
|
|
|
|
|
hr = pDispatch->lpVtbl->QueryInterface(pDispatch, &IID_IWebBrowserApp, &pWebBrowserApp); |
|
|
|
|
|
|
|
if (pWebBrowserApp) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IServiceProvider* pServiceProvider = NULL; |
|
|
|
|
|
|
|
hr = pWebBrowserApp->lpVtbl->QueryInterface(pWebBrowserApp, &IID_IServiceProvider, &pServiceProvider); |
|
|
|
|
|
|
|
if (pServiceProvider) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IShellBrowser* pShellBrowser = NULL; |
|
|
|
|
|
|
|
hr = pServiceProvider->lpVtbl->QueryService(pServiceProvider, &SID_STopLevelBrowser, &IID_IShellBrowser, &pShellBrowser); |
|
|
|
|
|
|
|
if (pShellBrowser) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IShellView* pShellView = NULL; |
|
|
|
|
|
|
|
hr = pShellBrowser->lpVtbl->QueryActiveShellView(pShellBrowser, &pShellView); |
|
|
|
|
|
|
|
if (pShellView) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IFolderView* pFolderView = NULL; |
|
|
|
|
|
|
|
hr = pShellView->lpVtbl->QueryInterface(pShellView, &IID_IFolderView, &pFolderView); |
|
|
|
|
|
|
|
if (pFolderView) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
IPersistFolder2* pPersistFolder2 = NULL; |
|
|
|
|
|
|
|
hr = pFolderView->lpVtbl->GetFolder(pFolderView, &IID_IPersistFolder2, &pPersistFolder2); |
|
|
|
|
|
|
|
if (pPersistFolder2) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LPITEMIDLIST pCur = NULL; |
|
|
|
|
|
|
|
hr = pPersistFolder2->lpVtbl->GetCurFolder(pPersistFolder2, &pCur); |
|
|
|
|
|
|
|
if (pCur) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hr = psfDesktop->lpVtbl->GetDisplayNameOf(psfDesktop, pCur, SHGDN_FORPARSING, &strret); |
|
|
|
|
|
|
|
StrRetToBufW(&strret, pidl, wszCurPath, MAX_PATH); |
|
|
|
|
|
|
|
if (!_wcsnicmp(wszOrigPath, wszCurPath, 40) && wcslen(wszCurPath) == 40 && bFirst) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LPITEMIDLIST pNew = NULL; |
|
|
|
|
|
|
|
hr = SHGetFolderLocation(NULL, CSIDL_DRIVES, (HANDLE)-1, 0, &pNew); |
|
|
|
|
|
|
|
if (pNew) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hr = pShellBrowser->lpVtbl->BrowseObject(pShellBrowser, pNew, SBSP_SAMEBROWSER); |
|
|
|
|
|
|
|
if (SUCCEEDED(hr)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
HWND hWndExp = NULL; |
|
|
|
|
|
|
|
pWebBrowserApp->lpVtbl->get_HWND(pWebBrowserApp, &hWndExp); |
|
|
|
|
|
|
|
if (hWndExp) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
INPUT input; |
|
|
|
|
|
|
|
ZeroMemory(&input, sizeof(INPUT)); |
|
|
|
|
|
|
|
input.type = INPUT_KEYBOARD; |
|
|
|
|
|
|
|
input.ki.wVk = VK_F5; |
|
|
|
|
|
|
|
SetForegroundWindow(hWndExp); |
|
|
|
|
|
|
|
SendInput(1, &input, sizeof(INPUT)); |
|
|
|
|
|
|
|
bFirst = FALSE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CoTaskMemFree(pNew); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CoTaskMemFree(pCur); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pPersistFolder2->lpVtbl->Release(pPersistFolder2); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pFolderView->lpVtbl->Release(pFolderView); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pShellView->lpVtbl->Release(pShellView); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pShellBrowser->lpVtbl->Release(pShellBrowser); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pServiceProvider->lpVtbl->Release(pServiceProvider); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pWebBrowserApp->lpVtbl->Release(pWebBrowserApp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pDispatch->lpVtbl->Release(pDispatch); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
pShellWindows->lpVtbl->Release(pShellWindows); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
CoTaskMemFree(pidl); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
psfDesktop->lpVtbl->Release(psfDesktop); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
dwMaxHeight += dwLineHeight * dy; |
|
|
|
dwMaxHeight += dwLineHeight * dy; |
|
|
|
|