Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify usage of FileExplorerContextMenus #117

Closed
AliveDevil opened this issue Apr 19, 2019 · 6 comments
Closed

Clarify usage of FileExplorerContextMenus #117

AliveDevil opened this issue Apr 19, 2019 · 6 comments

Comments

@AliveDevil
Copy link

Please provide a sample on how we are supposed to use FileExplorerContextMenus with

  • ExeServer
  • SurrogateServer

Please extend which interfaces are available for consumption here.

  • Is IShellExtInit supported?
  • Is IContextMenu supported?
  • If not, when will this functionality be available?

How are we supposed to register COM Objects consumable by Windows Explorer Shell to extend the file explorer context menu?
I tried several variants of DllMain, Main(), registering my COM objects with C++, C++/CX, C# on UWP and Packaging Project without any success.

My latest failing attempt looks like this:

<Applications>
	<Application Id="App"
		Executable="$targetnametoken$.exe"
		EntryPoint="$targetentrypoint$">
		<uap:VisualElements
			DisplayName="ShellApp.Package"
			Description="ShellApp.Package"
			BackgroundColor="transparent"
			Square150x150Logo="Images\Square150x150Logo.png"
			Square44x44Logo="Images\Square44x44Logo.png">
			<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
		</uap:VisualElements>
		<Extensions>
			<desktop4:Extension Category="windows.fileExplorerContextMenus">
				<desktop4:FileExplorerContextMenus>
					<desktop5:ItemType Type="*">
						<desktop5:Verb Id="ShellApp" Clsid="840C5236-4B3F-4320-8CD6-79B8CA95FCC0" />
					</desktop5:ItemType>
					<desktop5:ItemType Type="Directory">
						<desktop5:Verb Id="ShellApp" Clsid="840C5236-4B3F-4320-8CD6-79B8CA95FCC0" />
					</desktop5:ItemType>
					<desktop5:ItemType Type="Directory\Background">
						<desktop5:Verb Id="ShellApp" Clsid="840C5236-4B3F-4320-8CD6-79B8CA95FCC0" />
					</desktop5:ItemType>
				</desktop4:FileExplorerContextMenus>
			</desktop4:Extension>

			<com:Extension Category="windows.comServer">
				<com:ComServer>
					<!--<com:SurrogateServer>
						<com:Class Id="840C5236-4B3F-4320-8CD6-79B8CA95FCC0" Path="ShellApp\ShellApp.exe" ThreadingModel="Neutral" />
					</com:SurrogateServer>-->
					<com:ExeServer Executable="ShellApp\ShellApp.exe">
						<com:Class Id="840C5236-4B3F-4320-8CD6-79B8CA95FCC0" />
					</com:ExeServer>
				</com:ComServer>
			</com:Extension>
		</Extensions>
	</Application>
</Applications>

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@constant-arapov
Copy link

constant-arapov commented May 15, 2019

Have You found a solution ? If You've found, tell me please. I've got the same prolbem. I just want to add a reference to winodws context menu. But using similar solution as You also have no success.

@mcleanbyron
Copy link
Contributor

Hello - We recently added some related packaging examples to this article that demonstrate how to use this packaging extension to register a context menu implemented via IExplorerCommand and/or IExplorerCommandState. I updated the remarks to this article to point to those examples. I hope this helps!

@AliveDevil
Copy link
Author

Thanks for those examples. Just a quick question here: Is it possible to somehow get an example in a managed-language instead of relying on C++ (C++/CX)?

@vors
Copy link

vors commented Sep 24, 2019

@AliveDevil where did you find the <desktop5:ItemType Type="Directory"> documentation ? My understanding is that desktop4:ItemType is limited only to the files, not folders. But the MS documentation about desktop5:ItemType doesn't mention it. (opened #142)

@AliveDevil
Copy link
Author

See #142 (comment).

mijacobs pushed a commit that referenced this issue Feb 20, 2020
@DineshSolanki
Copy link

Thanks for those examples. Just a quick question here: Is it possible to somehow get an example in a managed-language instead of relying on C++ (C++/CX)?

also looking for same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants