mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[PowerRename][ImageResizer] Tier1 Win11 Context menu (#19000)
* Test win11 tier1 context menu
* Try to test signing
* Cleanup
* Cleanup project file
* Sign dll
Add PowerToys preffix
Add assets to installer
* expect.txt
* Switch to named pipes
Unregister package on uninstall
Remove unneeded files
Cleanup
* Bring back check if package registered but use per-user method
* Fix win11 check
* expect.txt
* Check if package already registered
* Revert "Check if package already registered"
FindPackages() method needs admin privileges.
This reverts commit 5af584fed4.
* Fix PowerRename args checking
* Cleanup assets
* Tier1 context menu ImageResizer
Minor cleanups
Move logic to package.h
* [WIP] Signing and installer
Expect.txt
* Localized context menu title
* Retarget everything 10.0.18362.0 -> 10.0.19041.0
* Address PR comments
- check if selection renamable
- minor cleanup
- struct initialization
* Fix ImageResizerLib project configuration
* More Windows version updates
* Remove unneeded file & try fix resource build error
* Add Microsoft.PowerToys prefix to packages
* Test
* Fix convert-resx-to-rc.ps1 script issue causing resource files compile error
Don't generate empty STRINGTABLE for resx files without data
* Avoid duplicate context menu items
* [BugReportTool] Report installed context menu packages
This commit is contained in:
@@ -520,6 +520,31 @@ BOOL GetEnumeratedFileName(__out_ecount(cchMax) PWSTR pszUniqueName, UINT cchMax
|
||||
return fRet;
|
||||
}
|
||||
|
||||
// Iterate through the shell items array and checks if at least 1 item has SFGAO_CANRENAME.
|
||||
// We do not enumerate child items - only the items the user selected.
|
||||
bool ShellItemArrayContainsRenamableItem(_In_ IShellItemArray* shellItemArray)
|
||||
{
|
||||
bool hasRenamable = false;
|
||||
IEnumShellItems* spesi;
|
||||
if (SUCCEEDED(shellItemArray->EnumItems(&spesi)))
|
||||
{
|
||||
ULONG celtFetched;
|
||||
IShellItem* spsi;
|
||||
while ((S_OK == spesi->Next(1, &spsi, &celtFetched)))
|
||||
{
|
||||
SFGAOF attrs;
|
||||
if (SUCCEEDED(spsi->GetAttributes(SFGAO_CANRENAME, &attrs)) &&
|
||||
attrs & SFGAO_CANRENAME)
|
||||
{
|
||||
hasRenamable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hasRenamable;
|
||||
}
|
||||
|
||||
// Iterate through the data source and checks if at least 1 item has SFGAO_CANRENAME.
|
||||
// We do not enumerate child items - only the items the user selected.
|
||||
bool DataObjectContainsRenamableItem(_In_ IUnknown* dataSource)
|
||||
|
||||
Reference in New Issue
Block a user