It is currently October 19th, 2020, 9:50 pm

Recycle Bin context menu

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 11575
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Recycle Bin context menu

Post by balala »

Yincognito wrote: October 15th, 2020, 6:21 pm To be fair, there isn't much to thank me for either,
Much less me...
mak_kawa
Posts: 905
Joined: December 30th, 2015, 9:47 am

Re: Recycle Bin context menu

Post by mak_kawa »

Hi Yincognito and balala

I just thank you for taking time to talk with me, even if my aim wasn't achieved so far. :-)

BTW, as the FileView plugin has [!CommandMeasure SomeMeasure ContextMenu] command (and even Properties!), I assume that the plugin uses some API that calls context menu for file path. If so, RecycleManager measure also can use such API for the integrated RecycleBin and implement similar measure command? ... just my thought, but expect.
User avatar
Yincognito
Posts: 2760
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Recycle Bin context menu

Post by Yincognito »

mak_kawa wrote: October 15th, 2020, 10:00 pm Hi Yincognito and balala

I just thank you for taking time to talk with me, even if my aim wasn't achieved so far. :-)

BTW, as the FileView plugin has [!CommandMeasure SomeMeasure ContextMenu] command (and even Properties!), I assume that the plugin uses some API that calls context menu for file path. If so, RecycleManager measure also can use such API for the integrated RecycleBin and implement similar measure command? ... just my thought, but expect.
But isn't the context menu of the Recycle Bin desktop icon entirely different from the context menu of a $Recycle.Bin folder? :???:
User avatar
Yincognito
Posts: 2760
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Recycle Bin context menu

Post by Yincognito »

mak_kawa wrote: October 15th, 2020, 10:00 pmI just thank you for taking time to talk with me, even if my aim wasn't achieved so far. :-)
I think I may have the answer for you, mak_kawa - you know my motto, nothing is impossible. :sly: This will most likely work, as Rainmeter has the capability of doing everything required for this. 8-)

P.S. It won't open the context menu of Recycle Bin or its properties, but it will do pretty much everything available in the properties window.

EDIT:

I'll be a bit busy tomorrow, so I'll just show you how to do it:
- use either: mountvol /L (in either CMD or PowerShell), WMIC or a PowerShell command like:

Code: Select all

gwmi -class Win32_Volume -filter "NOT DriveLetter like ''" | select DriveLetter,DeviceID | sort DriveLetter | format-list
to get your drives' GUIDs (unique names enclosed between curly brackets). The string and extraction from it can be manipulated in PowerShell directly, or through a Substitute in the RunCommand measure used to run the command
- once you get the GUID, the registry path of the Recycle Bin settings for your drive will be:

Code: Select all

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\{GUID}
where you'll have the same settings that are available in the Recycle Bin Properties window, albeit under slightly different names, i.e. MaxCapacity and NukeOnDelete
- to be able to modify those settings, use a PowerShell code like (this sets the maximum storage size of Recycle Bin for C: drive to 5000 MB):

Code: Select all

$Size=5000
$Volume=mountvol C:\ /L 
$Guid=[regex]::Matches($Volume,'{([-0-9A-F].*?)}')
$RegKey="HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\Volume\"+$Guid.value
New-ItemProperty -Path $RegKey -Name MaxCapacity -Value $Size -PropertyType "dword" -Force
The code above already gets the C: GUID, but as I said, such info can be extracted through your RunCommand measure as well. Once you have the desired GUID, you can even build your own .REG file and execute it in a bang (try to export from those registry keys, to figure out the exact syntax), instead of having to write the PowerShell code for each drive - even though that won't be complicated either since only the drive letter, the desired value or the key name change.

All in all, if there is a "complicated" part, it's extracting the GUID(s) from the mountvol or gwmi output, but even that isn't that hard if carefully designing the regex. Naturally, you can even replicate the Recycle Bin Properties window in a small skin, if you like - some InputTexts and buttons should do the job, considering that you can already get the current values of those settings using some Registry measures, and the set part is clear.

If you want to implement this and encounter difficulties and such, feel free to use your constitutional right to reply on this forum, LOL. Oh, and yeah, now you can say thanks. The approach is not exactly as easy as envisioned with just a simple CLSID in a bang, but it isn't a whole lot complicated either, and it should work. Obviously, you should first make sure everything goes smooth by running whatever is needed to test this from CMD or PowerShell, and make a backup of the registry before attempting to modify it, just to be on the safe side.
User avatar
Active Colors
Moderator
Posts: 618
Joined: February 16th, 2012, 3:32 am

Re: Recycle Bin context menu

Post by Active Colors »

System.Shell.RecycleBin.showRecycleSettings 🤔

--------
Also, is there a way to run a clsid with a "property"? or check them out and try launching in some way:

Code: Select all

HKCR\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\ControlPanel

Code: Select all

HKCU\Software\Classes\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\shellex\PropertySheetHandlers

Code: Select all

HKCR\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\{28636AA6-953D-11D2-B5D6-00C04FD918D0} 6
----------
Apart from the window class which is called#32770 I haven't found anything else :/