Must shell extension be not in the main STA?
I have a shell extension dll that adds a menu item in the context menu. But it can only run after I add the value ThreadingModel=Apartment in the InProcServer32 key of registry. Without the value, the dll cannot be loaded. I wonder if there is a requirement for the threading model of a shell extension dll. Which apartment does the thread instantiating the COM object in the shell extension dll belong to?
Shell extension in Explorer run as administrator
I have a shell extension(COM server in a dll adding a new menu item in the context menu) that runs well in Explorer run as a normal user. I want to see if it can run in Explorer run as administrator, so I right-click C:windowsexplorer.exe and select “run as administrator”. Then I find the shell extension is not started in the Explorer run as administrator. Then, I enable the administrator account in Windows 10 and login the PC as administrator, and find the shell extension works well there. However, when I switch back to the normal account, the shell extension is not started both in normal explorer and the explorer run as administrator.