It is currently April 20th, 2024, 2:54 am

Using CLSID's with Rainmeter

Tips and Tricks from the Rainmeter Community
User avatar
Brian
Developer
Posts: 2679
Joined: November 24th, 2011, 1:42 am
Location: Utah

Using CLSID's with Rainmeter

Post by Brian »

Using CLSID's with Rainmeter

Rainmeter has the ability to launch Windows "Special Folders" using its unique CLSID. "Special Folders" include "Recycle Bin", "Computer (or My Computer)", "My Documents", and more. Most of "Windows Special Folders" are not part of your filesystem, meaning you cannot* specify an "absolute path" to access them. CLSID stands for "Class Identifier" (or "Class ID") and are used by the Windows OS to identify software applications or components without having to know the "name" of the object.

With Rainmeter, you can launch CLSID's inside an action to open its "virtual" folder.

For example: LeftMouseUpAction=["::{20d04fe0-3aea-1069-a2d8-08002b30309d}"] will open your Computer (or My Computer) folder. However, only certain CLSID's can be launched this way.

Here is a list of CLSID's you can use with the Mouse and IfActions described above:
NOTE: These have been tested on Windows 7 64-bit, your version may or may not be able to use these CLSID's
  • Computer (or My Computer) ::{20d04fe0-3aea-1069-a2d8-08002b30309d}
  • Control Panel (Category View) ::{26EE0668-A00A-44D7-9371-BEB064C98683}
  • Control Panel (Icon View) ::{21EC2020-3AEA-1069-A2DD-08002B30309D} or ::{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}
  • Games ::{ED228FDF-9EA8-4870-83b1-96b02CFE0D52}
  • Libraries ::{031E4825-7B94-4dc3-B131-E946B44C8DD5}
  • HomeGroup ::{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}
  • My Documents ::{450d8fba-ad25-11d0-98a8-0800361b1103}
  • Network ::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}
  • Network Connections ::{7007ACC7-3202-11D1-AAD2-00805FC1270E}
  • Network (WorkGroup) Places (or My Network Places) ::{208D2C60-3AEA-1069-A2D7-08002B30309D}
  • Printers Folder ::{2227A280-3AEA-1069-A2DE-08002B30309D}
  • Public Folder ::{4336a54d-038b-4685-ab02-99bb52d3fb8b}
  • Recycle Bin ::{645FF040-5081-101B-9F08-00AA002F954E}
  • Search Results ::{9343812e-1c37-4a49-a12e-4b2d810d956b}
  • User Folder ::{59031a47-3f72-44a7-89c5-5595fe6b30ee}
Another way to launch CLSID's is to use the "shell:" command. (Thanks Arne Anka for the heads up!)

For example: To open the "Programs Folder" you cannot use this: ["::{7be9d83c-a729-4d97-b5a7-1b7313c39e0a}"], but you can open the folder like this: ["shell:::{7be9d83c-a729-4d97-b5a7-1b7313c39e0a}"] (Yes, that is 3 ":" in a row).
NOTE: The "shell:" command can be used with any CLSID's in the list above AND any provided in the link below.

Here is a good list of CLSID's: http://www.sevenforums.com/tutorials/110919-clsid-key-list-windows-7-a.html
NOTE: Some of these CLSID's will not be available for older versions of Windows.

Another useful trick is to specify a "subfolder" under your CLSID. This becomes useful when you want to open a "Special Folders" subfolder from your skin. You can also open a specific file this way too.

For example: Let's say you have a folder located here: "My Documents\Pictures\Paris 2012\". You can use the CLSID for "My Documents", then append the subfolder(s) after it, like this: "::{450d8fba-ad25-11d0-98a8-0800361b1103}\Pictures\Paris 2012\".

Let's take it one step further. Assume you have a file named "Eiffel Tower.jpg" located in the folder "My Documents\Pictures\Paris 2012\" and you want to be able to click some text and have it open that file. Here is an example of how to accomplish this:

Code: Select all

[meterEiffelTower]
Meter=String
SolidColor=0,0,0,1
FontColor=255,255,255,255
Text="Eiffel Tower"
LeftMouseUpAction=["::{450d8fba-ad25-11d0-98a8-0800361b1103}\Pictures\Paris 2012\Eiffel Tower.jpg"]
When you click the text "Eiffel Tower", the file "Eiffel Tower.jpg" will open in your default image program ("Windows Photo Viewer" is the default program associated with ".jpg" files, other programs may change this).

Another way to open this file is to pass the "virtual" path as a parameter to some program.

Code: Select all

[meterEiffelTower]
Meter=String
SolidColor=0,0,0,1
FontColor=255,255,255,255
Text="Eiffel Tower"
LeftMouseUpAction=["shell:ProgramFiles\Adobe\Photoshop\Photoshop.exe" "::{450d8fba-ad25-11d0-98a8-0800361b1103}\Pictures\Paris 2012\Eiffel Tower.jpg"]
This would open the file "Eiffel Tower.jpg" inside Photoshop.
Note: This also uses the "shell:" command. More information on the "shell:" command is located here.

Important Note: You cannot use CLSID's outside of an action. (ie. You cannot use CLSID's in options like "ImageName") However, as Rainmeter evolves, the use of CLSID's in places other than Mouse and IfActions may be supported in the future.

-Brian

* - Certain "Special Folders" can be accessed through the filesystem like "My Documents", but most "Special Folders" are actually "virtual" (ie. "Computer (or My Computer)" is not an actual folder in your filesystem). Click here for more information on "Special Folders".
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: Using CLSID's with Rainmeter

Post by smurfier »

Another way to specify a virtual path is with Environment Variables, which you also can use in Rainmeter:

LeftMouseUpAction=["%ProgramFiles%"]
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .