Windows Shell扩展上下文菜单和Winform问题 [英] Windows Shell Extension Context Menu and Winform problem

查看:92
本文介绍了Windows Shell扩展上下文菜单和Winform问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我按照本教程

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:

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

推荐答案

该解决方案为表单创建可执行文件,然后启动一个新过程,如下所示:


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


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


这篇关于Windows Shell扩展上下文菜单和Winform问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆