1
0
mirror of https://github.com/valinet/ExplorerPatcher.git synced 2025-02-20 20:41:26 +01:00

Spotlight: Added section, logic and configuration parameters

This commit includes support for the Windows spotlight feature from
22000.708+ OS builds.
Related to this, ExplorerPatcher now offers the following functionality:
* Hide the "Learn about this picture" icon
* Choose which items from the Windows spotlight icon context menu to
  have replicated in the desktop context menu (legacy context menu only)
* Set a schedule for "Switch to next picture"
* Manipulate the feature from the Properties UI, bypassing the desktop
  icon
This commit is contained in:
Valentin Radu 2022-05-26 11:17:53 +03:00
parent 13e1cc7a1b
commit d0ad8bd1e3
5 changed files with 450 additions and 8 deletions

View File

@ -1296,6 +1296,52 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
}
if (!bOk) continue;
}
else if (!wcsncmp(text, L"%SPOTLIGHTINFOTIP1%", 18))
{
DWORD dwDataSize = MAX_LINE_LENGTH;
RegGetValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", L"InfoTip", RRF_RT_REG_SZ, NULL, text, &dwDataSize);
WCHAR* pC = wcschr(text, L'\r');
if (pC) pC[0] = 0;
}
else if (!wcsncmp(text, L"%SPOTLIGHTINFOTIP2%", 18))
{
DWORD dwDataSize = MAX_LINE_LENGTH;
RegGetValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", L"InfoTip", RRF_RT_REG_SZ, NULL, text, &dwDataSize);
WCHAR* pC = wcschr(text, L'\r');
if (pC)
{
int d = (pC - text) + 1;
for (int i = d; i < wcslen(text); ++i)
{
text[i - d] = text[i];
}
pC = wcschr(text, L'\r');
if (pC)
{
pC[0] = 0;
}
}
}
else if (!wcsncmp(text, L"%SPOTLIGHTCLICK%", 16))
{
DWORD dwDataSize = MAX_LINE_LENGTH;
RegQueryValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", text, &dwDataSize);
}
else if (!wcsncmp(text, L"%SPOTLIGHTDISLIKE%", 18))
{
DWORD dwDataSize = MAX_LINE_LENGTH;
RegQueryValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}\\shell\\SpotlightDislike", text, &dwDataSize);
}
else if (!wcsncmp(text, L"%SPOTLIGHTLIKE%", 15))
{
DWORD dwDataSize = MAX_LINE_LENGTH;
RegQueryValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}\\shell\\SpotlightLike", text, &dwDataSize);
}
else if (!wcsncmp(text, L"%SPOTLIGHTNEXT%", 15))
{
DWORD dwDataSize = MAX_LINE_LENGTH;
RegQueryValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}\\shell\\SpotlightNext", text, &dwDataSize);
}
if (bResetLastHeading)
{
wcscpy_s(lastHeading, MAX_LINE_LENGTH, text);
@ -2257,6 +2303,30 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
psfDesktop->lpVtbl->Release(psfDesktop);
}
}
else if (!strncmp(line + 1, "spotlight_menu", 14))
{
POINT p;
p.x = rcText.left;
p.y = rcText.bottom;
ClientToScreen(hwnd, &p);
SpotlightHelper(SPOP_OPENMENU, hwnd, NULL, &p);
}
else if (!strncmp(line + 1, "spotlight_click", 15))
{
SpotlightHelper(SPOP_CLICKMENU_OPEN, hwnd, NULL, &p);
}
else if (!strncmp(line + 1, "spotlight_next", 14))
{
SpotlightHelper(SPOP_CLICKMENU_NEXTPIC, hwnd, NULL, &p);
}
else if (!strncmp(line + 1, "spotlight_like", 14))
{
SpotlightHelper(SPOP_CLICKMENU_LIKE, hwnd, NULL, &p);
}
else if (!strncmp(line + 1, "spotlight_dislike", 17))
{
SpotlightHelper(SPOP_CLICKMENU_DISLIKE, hwnd, NULL, &p);
}
}
}
dwMaxHeight += dwLineHeight * dy;

View File

@ -154,6 +154,9 @@ DWORD dwTaskbarSmallIcons = FALSE;
DWORD dwShowTaskViewButton = FALSE;
DWORD dwSearchboxTaskbarMode = FALSE;
DWORD dwTaskbarDa = FALSE;
DWORD bDisableSpotlightIcon = FALSE;
DWORD dwSpotlightDesktopMenuMask = 0;
DWORD dwSpotlightUpdateSchedule = 0;
int Code = 0;
HRESULT InjectStartFromExplorer();
void InvokeClockFlyout();
@ -809,7 +812,11 @@ LRESULT CALLBACK EP_Service_Window_WndProc(
}
return 0;
}
else if (uMsg == WM_TIMER && wParam == 100)
{
if (IsSpotlightEnabled()) SpotlightHelper(SPOP_CLICKMENU_NEXTPIC, hWnd, NULL, NULL);
printf("Refreshed Spotlight\n");
}
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
DWORD EP_ServiceWindowThread(DWORD unused)
@ -839,6 +846,7 @@ DWORD EP_ServiceWindowThread(DWORD unused)
);
if (hWndServiceWindow)
{
if (IsSpotlightEnabled() && dwSpotlightUpdateSchedule) SetTimer(hWndServiceWindow, 100, dwSpotlightUpdateSchedule * 1000, NULL);
if (bClockFlyoutOnWinC)
{
RegisterHotKey(hWndServiceWindow, 1, MOD_WIN | MOD_NOREPEAT, 'C');
@ -5664,12 +5672,13 @@ DWORD WindowSwitcher(DWORD unused)
#pragma region "Load Settings from registry"
#define REFRESHUI_NONE 0b00000
#define REFRESHUI_GLOM 0b00001
#define REFRESHUI_ORB 0b00010
#define REFRESHUI_PEOPLE 0b00100
#define REFRESHUI_TASKBAR 0b01000
#define REFRESHUI_CENTER 0b10000
#define REFRESHUI_NONE 0b000000
#define REFRESHUI_GLOM 0b000001
#define REFRESHUI_ORB 0b000010
#define REFRESHUI_PEOPLE 0b000100
#define REFRESHUI_TASKBAR 0b001000
#define REFRESHUI_CENTER 0b010000
#define REFRESHUI_SPOTLIGHT 0b100000
void WINAPI LoadSettings(LPARAM lParam)
{
BOOL bIsExplorer = LOWORD(lParam);
@ -6323,6 +6332,55 @@ void WINAPI LoadSettings(LPARAM lParam)
);
dwTemp = FALSE;
dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("SpotlightDisableIcon"),
0,
NULL,
&dwTemp,
&dwSize
);
if (dwTemp != bDisableSpotlightIcon)
{
bDisableSpotlightIcon = dwTemp;
if (IsSpotlightEnabled()) dwRefreshUIMask |= REFRESHUI_SPOTLIGHT;
}
dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("SpotlightDesktopMenuMask"),
0,
NULL,
&dwSpotlightDesktopMenuMask,
&dwSize
);
dwTemp = 0;
dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("SpotlightUpdateSchedule"),
0,
NULL,
&dwTemp,
&dwSize
);
if (dwTemp != dwSpotlightUpdateSchedule)
{
dwSpotlightUpdateSchedule = dwTemp;
if (IsSpotlightEnabled() && hWndServiceWindow)
{
if (dwSpotlightUpdateSchedule)
{
SetTimer(hWndServiceWindow, 100, dwSpotlightUpdateSchedule * 1000, NULL);
}
else
{
KillTimer(hWndServiceWindow, 100);
}
}
}
dwTemp = FALSE;
dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("PinnedItemsActAsQuickLaunch"),
@ -6941,6 +6999,16 @@ void WINAPI LoadSettings(LPARAM lParam)
FixUpCenteredTaskbar();
#endif
}
if (dwRefreshUIMask & REFRESHUI_SPOTLIGHT)
{
DWORD dwAttributes = 0; dwTemp = sizeof(DWORD);
RegGetValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}\\ShellFolder", L"Attributes", RRF_RT_DWORD, NULL, &dwAttributes, &dwTemp);
if (bDisableSpotlightIcon) dwAttributes |= SFGAO_NONENUMERATED;
else dwAttributes &= ~SFGAO_NONENUMERATED;
RegSetKeyValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}\\ShellFolder", L"Attributes", REG_DWORD, &dwAttributes, sizeof(DWORD));
SHFlushSFCache();
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
}
}
}
@ -9106,6 +9174,68 @@ BOOL SHELL32_CanDisplayWin8CopyDialogHook()
#pragma endregion
#pragma region "Windows Spotlight customization"
HKEY hKeySpotlight1 = NULL;
HKEY hKeySpotlight2 = NULL;
LSTATUS shell32_RegCreateKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, const LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition)
{
if (bDisableSpotlightIcon && hKey == HKEY_CURRENT_USER && !_wcsicmp(lpSubKey, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}"))
{
LSTATUS lRes = RegCreateKeyExW(hKey, lpSubKey, Reserved, lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
if (lRes == ERROR_SUCCESS) hKeySpotlight1 = *phkResult;
return lRes;
}
else if (hKeySpotlight1 && hKey == hKeySpotlight1 && !_wcsicmp(lpSubKey, L"ShellFolder"))
{
LSTATUS lRes = RegCreateKeyExW(hKey, lpSubKey, Reserved, lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
if (lRes == ERROR_SUCCESS) hKeySpotlight2 = *phkResult;
return lRes;
}
return RegCreateKeyExW(hKey, lpSubKey, Reserved, lpClass, dwOptions, samDesired, lpSecurityAttributes, phkResult, lpdwDisposition);
}
LSTATUS shell32_RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE* lpData, DWORD cbData)
{
if (hKeySpotlight1 && hKeySpotlight2 && hKey == hKeySpotlight2 && !_wcsicmp(lpValueName, L"Attributes"))
{
hKeySpotlight1 = NULL;
hKeySpotlight2 = NULL;
DWORD dwAttributes = *(DWORD*)lpData | SFGAO_NONENUMERATED;
SHFlushSFCache();
return RegSetValueExW(hKey, lpValueName, Reserved, dwType, &dwAttributes, cbData);
}
return RegSetValueExW(hKey, lpValueName, Reserved, dwType, lpData, cbData);
}
BOOL shell32_DeleteMenu(HMENU hMenu, UINT uPosition, UINT uFlags)
{
if (uPosition == 0x7053 && IsSpotlightEnabled() && dwSpotlightDesktopMenuMask)
{
SpotlightHelper(dwSpotlightDesktopMenuMask, GetDesktopWindow(), hMenu, NULL);
}
return DeleteMenu(hMenu, uPosition, uFlags);
}
BOOL shell32_TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, int nReserved, HWND hWnd, const RECT* prcRect)
{
BOOL bRet = TrackPopupMenuHook(hMenu, uFlags, x, y, nReserved, hWnd, prcRect);
if (IsSpotlightEnabled() && dwSpotlightDesktopMenuMask)
{
MENUITEMINFOW mii;
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_FTYPE | MIIM_DATA;
if (GetMenuItemInfoW(hMenu, bRet, FALSE, &mii) && mii.dwItemData >= SPOP_CLICKMENU_FIRST && mii.dwItemData <= SPOP_CLICKMENU_LAST)
{
SpotlightHelper(mii.dwItemData, hWnd, hMenu, NULL);
}
}
return bRet;
}
#pragma endregion
DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
{
//Sleep(150);
@ -9129,7 +9259,14 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
{
if (bInstall)
{
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", TrackPopupMenuHook);
if (DoesOSBuildSupportSpotlight())
{
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", shell32_TrackPopupMenu);
}
else
{
VnPatchIAT(hShell32, "user32.dll", "TrackPopupMenu", TrackPopupMenuHook);
}
VnPatchIAT(hShell32, "user32.dll", "SystemParametersInfoW", DisableImmersiveMenus_SystemParametersInfoW);
if (!bIsExplorer)
{
@ -9975,6 +10112,14 @@ DWORD Inject(BOOL bIsExplorer)
pClassFactory->lpVtbl->Release(pClassFactory);
}
}
// Disable Windows Spotlight icon
if (DoesOSBuildSupportSpotlight())
{
VnPatchIAT(hShell32, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegCreateKeyExW", shell32_RegCreateKeyExW);
VnPatchIAT(hShell32, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegSetValueExW", shell32_RegSetValueExW);
VnPatchIAT(hShell32, "user32.dll", "DeleteMenu", shell32_DeleteMenu);
}
}
printf("Setup shell32 functions done\n");

View File

@ -516,6 +516,54 @@
;s Spotlight_SpotlightOSCheck DoesOSBuildSupportSpotlight
;T Spotlight
[HKEY_CURRENT_USER\Software\ExplorerPatcher]
;t When using Windows spotlight as desktop background:
;b Hide the "Learn about this picture" icon
"SpotlightDisableIcon"=dword:00000000
;c 8 Desktop context menu items
;x 0 No items
;x 32 Switch to the next picture
;x 48 Learn about and switch to next picture
;x 288 Info and switch to next picture
;x 800 Info, copyright, and switch to next picture
;x 304 Info, learn about, and switch to next picture
;x 816 Info, copyright, learn about, and switch to next picture
;x 1008 All items
"SpotlightDesktopMenuMask"=dword:00000000
;c 11 Update frequency
;x 0 Let Windows decide the best schedule (default)
;x 60 Every minute
;x 300 Every 5 minutes
;x 900 Every 15 minutes
;x 1200 Every 20 minutes
;x 1800 Every half an hour
;x 3600 Every hour
;x 7200 Every couple of hours
;x 21600 Every 6 hours
;x 43200 Every 12 hours
;x 86400 Once a day
"SpotlightUpdateSchedule"=dword:00000000
;s Spotlight_SpotlightEnabledCheck IsSpotlightEnabled
;u %SPOTLIGHTCLICK%
;spotlight_click
;t %SPOTLIGHTINFOTIP1%
;t %SPOTLIGHTINFOTIP2%
;u %SPOTLIGHTNEXT%
;spotlight_next
;u %SPOTLIGHTLIKE%
;spotlight_like
;u %SPOTLIGHTDISLIKE%
;spotlight_dislike
;;;u Show more options
;;;spotlight_menu
;g Spotlight_SpotlightEnabledCheck
;g Spotlight_SpotlightOSCheck
;T Other
[HKEY_CURRENT_USER\Software\ExplorerPatcher]
;b Remember last used section in this window

View File

@ -1466,3 +1466,158 @@ BOOL IsConnectedToInternet()
}
return connectedStatus;
}
BOOL DoesOSBuildSupportSpotlight()
{
return global_rovi.dwBuildNumber >= 22000 && global_ubr >= 706;
}
BOOL IsSpotlightEnabled()
{
HKEY hKey = NULL;
BOOL bRet = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2CC5CA98-6485-489A-920E-B3E88A6CCCE3}", 0, KEY_READ, &hKey) == ERROR_SUCCESS;
if (bRet) RegCloseKey(hKey);
return bRet;
}
const int spop_insertmenu_ops[] = { SPOP_INSERTMENU_OPEN, SPOP_INSERTMENU_NEXTPIC, 0, SPOP_INSERTMENU_LIKE, SPOP_INSERTMENU_DISLIKE };
void SpotlightHelper(DWORD dwOp, HWND hWnd, HMENU hMenu, LPPOINT pPt)
{
HRESULT hr = S_OK;
LPITEMIDLIST pidl = NULL;
SFGAOF sfgao = 0;
if (SUCCEEDED(hr = SHParseDisplayName(L"::{2CC5CA98-6485-489A-920E-B3E88A6CCCE3}", NULL, &pidl, 0, &sfgao)))
{
IShellFolder* psf = NULL;
LPCITEMIDLIST pidlChild;
if (SUCCEEDED(hr = SHBindToParent(pidl, &IID_IShellFolder, (void**)&psf, &pidlChild)))
{
IContextMenu* pcm = NULL;
if (SUCCEEDED(hr = psf->lpVtbl->GetUIObjectOf(psf, hWnd, 1, &pidlChild, &IID_IContextMenu, NULL, &pcm)))
{
HMENU hMenu2 = CreatePopupMenu();
if (hMenu2)
{
if (SUCCEEDED(hr = pcm->lpVtbl->QueryContextMenu(pcm, hMenu2, 0, SCRATCH_QCM_FIRST, SCRATCH_QCM_LAST, CMF_NORMAL)))
{
if (dwOp == SPOP_OPENMENU)
{
int iCmd = TrackPopupMenuEx(hMenu2, TPM_RETURNCMD, pPt->x, pPt->y, hWnd, NULL);
if (iCmd > 0)
{
CMINVOKECOMMANDINFOEX info = { 0 };
info.cbSize = sizeof(info);
info.fMask = CMIC_MASK_UNICODE | CMIC_MASK_PTINVOKE;
info.hwnd = hWnd;
info.lpVerb = MAKEINTRESOURCEA(iCmd - SCRATCH_QCM_FIRST);
info.lpVerbW = MAKEINTRESOURCEW(iCmd - SCRATCH_QCM_FIRST);
info.nShow = SW_SHOWNORMAL;
info.ptInvoke = *pPt;
pcm->lpVtbl->InvokeCommand(pcm, &info);
}
}
else if (!(dwOp & ~SPOP_INSERTMENU_ALL))
{
MENUITEMINFOW mii;
int i = -1;
while (1)
{
if (i == -1 ? ((dwOp & SPOP_INSERTMENU_INFOTIP1) || (dwOp & SPOP_INSERTMENU_INFOTIP2)) : (dwOp & spop_insertmenu_ops[i]))
{
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_FTYPE | MIIM_STRING;
mii.cch = 0;
mii.dwTypeData = NULL;
if (i <= 0 ?
(i == 0 ?
!RegQueryValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", NULL, &mii.cch) :
!RegGetValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", L"InfoTip", RRF_RT_REG_SZ, NULL, NULL, &mii.cch)
) :
GetMenuItemInfoW(hMenu2, i, TRUE, &mii))
{
WCHAR* buf = malloc(++mii.cch * sizeof(WCHAR));
if (buf)
{
mii.dwTypeData = buf;
if (i <= 0 ?
(i == 0 ?
!RegQueryValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", mii.dwTypeData, &mii.cch) :
!RegGetValueW(HKEY_CURRENT_USER, L"Software\\Classes\\CLSID\\{2cc5ca98-6485-489a-920e-b3e88a6ccce3}", L"InfoTip", RRF_RT_REG_SZ, NULL, mii.dwTypeData, &mii.cch)
) :
GetMenuItemInfoW(hMenu2, i, TRUE, &mii))
{
if (i == -1)
{
WCHAR* pC = wcschr(mii.dwTypeData, L'\r');
if (pC)
{
pC[0] = 0;
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_DATA | MIIM_STATE;
mii.wID = 3999 + i - 1;
mii.dwItemData = SPOP_CLICKMENU_FIRST + i - 1;
mii.fType = MFT_STRING;
mii.fState = MFS_DISABLED;
if (dwOp & SPOP_INSERTMENU_INFOTIP1)
{
InsertMenuItemW(hMenu, GetMenuItemCount(hMenu) - 1, TRUE, &mii);
}
pC++;
WCHAR* pC2 = wcschr(pC, L'\r');
if (pC2)
{
pC2[0] = 0;
}
mii.dwTypeData = pC;
}
}
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_DATA | (i == -1 ? MIIM_STATE : 0);
mii.wID = 3999 + i;
mii.dwItemData = SPOP_CLICKMENU_FIRST + i;
mii.fType = MFT_STRING;
if (i == -1) mii.fState = MFS_DISABLED;
if (i != -1 || (i == -1 && (dwOp & SPOP_INSERTMENU_INFOTIP2)))
{
InsertMenuItemW(hMenu, GetMenuItemCount(hMenu) - 1, TRUE, &mii);
}
}
free(buf);
}
}
}
i++;
if (i >= ARRAYSIZE(spop_insertmenu_ops)) break;
}
mii.fMask = MIIM_FTYPE | MIIM_DATA;
mii.dwItemData = 0;
mii.fType = MFT_SEPARATOR;
InsertMenuItemW(hMenu, GetMenuItemCount(hMenu) - 1, TRUE, &mii);
}
else if (dwOp >= SPOP_CLICKMENU_FIRST && dwOp <= SPOP_CLICKMENU_LAST)
{
MENUITEMINFOW mii;
mii.cbSize = sizeof(MENUITEMINFOW);
mii.fMask = MIIM_ID;
if (GetMenuItemInfoW(hMenu2, dwOp - SPOP_CLICKMENU_FIRST, TRUE, &mii))
{
CMINVOKECOMMANDINFOEX info = { 0 };
info.cbSize = sizeof(info);
info.fMask = CMIC_MASK_UNICODE;
info.hwnd = hWnd;
info.lpVerb = MAKEINTRESOURCEA(mii.wID - SCRATCH_QCM_FIRST);
info.lpVerbW = MAKEINTRESOURCEW(mii.wID - SCRATCH_QCM_FIRST);
info.nShow = SW_SHOWNORMAL;
pcm->lpVtbl->InvokeCommand(pcm, &info);
}
}
}
DestroyMenu(hMenu2);
}
pcm->lpVtbl->Release(pcm);
}
psf->lpVtbl->Release(psf);
}
CoTaskMemFree(pidl);
}
}

View File

@ -560,4 +560,28 @@ BOOL DownloadAndInstallWebView2Runtime();
BOOL DownloadFile(LPCWSTR wszURL, DWORD dwSize, LPCWSTR wszPath);
BOOL IsConnectedToInternet();
#define SCRATCH_QCM_FIRST 1
#define SCRATCH_QCM_LAST 0x7FFF
#define SPOP_OPENMENU 1
#define SPOP_INSERTMENU_ALL 0b1111110000
#define SPOP_INSERTMENU_OPEN 0b0000010000
#define SPOP_INSERTMENU_NEXTPIC 0b0000100000
#define SPOP_INSERTMENU_LIKE 0b0001000000
#define SPOP_INSERTMENU_DISLIKE 0b0010000000
#define SPOP_INSERTMENU_INFOTIP1 0b0100000000
#define SPOP_INSERTMENU_INFOTIP2 0b1000000000
#define SPOP_CLICKMENU_FIRST 40000
#define SPOP_CLICKMENU_OPEN 40000
#define SPOP_CLICKMENU_NEXTPIC 40001
#define SPOP_CLICKMENU_LIKE 40002
#define SPOP_CLICKMENU_DISLIKE 40003
#define SPOP_CLICKMENU_LAST 40003
BOOL DoesOSBuildSupportSpotlight();
BOOL IsSpotlightEnabled();
void SpotlightHelper(DWORD dwOp, HWND hWnd, HMENU hMenu, LPPOINT pPt);
#endif