How can I retrieve the "CLSID_SeparateMultipleProcessExplorerHost", without querying the Registry? Is there any Win32 API to take the "CLSID_SeparateMultipleProcessExplorerHost" as parameter and give me the GUID of it.
Asked
Active
Viewed 3,222 times
0
-
String to CLSID or... what exactly? You can hardcode it if you want. – Roman R. Jan 23 '14 at 16:21
-
It is always `{75DFF2B7-6936-4C06-A8BB-676A7B00B24B}`. CLSIDs are designed to be unchanging. – Dark Falcon Jan 23 '14 at 16:24
-
Not exactly, guids *do* change when the underlying COM declaration changes. Which is why it is a symbol and not the literal guid. The registry knows beans about symbols or old versions that are not installed, it only knows the guid. That the default value of the CLSID registry key happens to have the same name as the symbol is an accident. Taking advantage of that accident is possible but *very* expensive, you'll have to iterate all of the CLSID keys. There are a lot of them. There is no winapi function for it beyond RegEnumKeyEx(). Hard-coding it is the practical solution. – Hans Passant Jan 23 '14 at 17:02
-
Once a COM object establishes a guid value for a given CLSID/IID, that guid value is locked in and does not ever change. If a COM object needs to be changed, it has to define a new CLSID/IID guid value for a new interface and leave the old interface and its CLSID/IID alone. That is a requirement of COM programming to maintain backwards compatibility with existing apps. – Remy Lebeau Jan 23 '14 at 17:12
-
Thanks for your replies. Can I hard code the ""{ceff45ee-c862-41de-aee2-a022c81eda92}" too? – santhiR Jan 23 '14 at 18:31
1 Answers
1
The string "CLSID_SeparateMultipleProcessExplorerHost"
does not exist in the Registry, or anywhere else. It is strictly the name of a compile-time constant value of {75DFF2B7-6936-4C06-A8BB-676A7B00B24B}
that is defined in the Win32 SDK for use in source code only. The name is stripped out during compiling.
Typically, if you pass a CLSID value to ProgIDFromCLSID()
at runtime, you will get the CLSID's associated ProgID name, which can be passed to CLSIDFromProgID()
at runtime to retrieve the CLSID. However, this particular CLSID does not have an associated ProgID, so that is not an option.

Remy Lebeau
- 555,201
- 31
- 458
- 770
-
You are correct of course in general, but the funny thing/exception here is that this particular string does exist, as a COM class description for this COM class :) Maybe this is the root cause of poster confusion here... – Roman R. Jan 23 '14 at 17:11
-
1In that case, the only option is it manually enumerate the `HKCR\CLSID` Registry key checking every subkey for that description. There is no API function to retrieve a CLSID from a description string. – Remy Lebeau Jan 23 '14 at 17:24
-
Thanks for your answers. That helps me to understand better. My requirement is to retrieve the "{ceff45ee-c862-41de-aee2-a022c81eda92}" value other than from the Registry. To compare the Explorer.exe arguments. as I don't want to hard code it, I m looking, if there is a way to retrieve the value? – santhiR Jan 23 '14 at 18:26
-
That CLSID is `CLSID_SeparateSingleProcessExplorerHost`. The only link between those two CLSIDs in the Registry is that they have the same `AppID` registered. The only other place I see that CLSID appear is in `HKCR\Folder\shell\opennewprocess`. What are you trying to accomplish? To spawn an instance of Explorer.exe with different factory parameters? If so, then just hard code the parameter values as needed. – Remy Lebeau Jan 23 '14 at 19:04
-
I wanted to differentiate between actual explorer.exe and explorer.exe with /factory "{ceff45ee-c862-41de-aee2-a022c81eda92}" as command line arguments. When the explorer has command this guid in command line, I would return false, else return true. I was doubtful, if I can hard code this GUID, would it not change with different versions of Windows operating systems? – santhiR Jan 23 '14 at 19:32