0

I just started writing my application which will help us to protect a folder with a password, when we open the menu on folders, we will see a "Create Password" entry. You can see this on the screen.

option "create password"

My question is: How can I get information abouth which folder the user has choosen, it's a WPF application and I can find nothing. Thanks for help and sorry for my language ;)

Maximilian Gerhardt
  • 5,188
  • 3
  • 28
  • 61
QuakeR
  • 66
  • 6
  • Seems like you've written a shell extension for the windows explorer right click menu, how does that relate to a C# WPF application oO? How did you implement /register that shell extension? – Maximilian Gerhardt Feb 04 '16 at 21:06
  • i wrote project in wpf application which let us create password on folder, but i don't know how to get information which folder user has choosen – QuakeR Feb 04 '16 at 21:14

1 Answers1

1

From this article about the SharpShell project, it looks like with it you would use the SelectedItemPaths property. Windows Shell Extensions in .NET says:

The purpose of the Initialize method is to get information about the selected items in the shell and save that information for later calls. The m_dataObject and m_hDrop fields are used to store this information in the COM object between calls.

(emphasis added)

But conventional wisdom and guidance is that you shouldn't, in general, write shell extensions in managed code.

Microsoft recommends against writing managed in-process extensions to Windows Explorer or Windows Internet Explorer and does not consider them a supported scenario.

(emphasis theirs)

They do give some examples where it is OK.

Community
  • 1
  • 1
Larry Smithmier
  • 2,711
  • 2
  • 23
  • 30
  • So should i write it again but in .net application? – QuakeR Feb 04 '16 at 21:34
  • Your question is tagged with C# and WPF. C# is a .NET language, WPF is the UI Framework that you are implementing with. The direction from MS is to use C++ or some other non-managed language. Updated the answer. – Larry Smithmier Feb 04 '16 at 23:54