Click here to Skip to main content
15,898,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,

I made a dll for Windows Shell Extension integration, following this tutorial http://blogs.msdn.com/b/codefx/archive/2010/09/14/writing-windows-shell-extension-with-net-framework-4-c-vb-net-part-1.aspx[^]

Now, I added a Windows form in that dll, I'm doing the following:

C#
void OnVerbDisplayFileName(IntPtr hWnd)
{
    ShowSelectedFiles form = new ShowSelectedFiles();
    form.Show(selectedFiles);
}


Everything works fine, just the Forms icon is not shown in task bar and I can't find the process that runs my form.

Any tip on how to solve this problem? Maybe by starting a new process and then showing the form?

Thanks
Posted

1 solution

The solution creating an executable for the form and then launching a new process, like this:


C#
void OnVerbDisplayFileName(IntPtr hWnd)
    {
        string file = (new System.Uri(Assembly.GetExecutingAssembly().CodeBase)).AbsolutePath;
        string executableName = file.Substring(0, file.LastIndexOf("/"));
        executableName += "/MyApp.exe";

        Process gui = new Process();

        gui.StartInfo.FileName = executableName;
        gui.StartInfo.Arguments = selectedFiles.JoinFileNames(" ");

        gui.Start();
    }



Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900