简体   繁体   English

如何在应用程序中隐藏DLL注册消息窗口?

[英]How can I hide DLL registration message window in my application?

I'm registering a dll at startup of my application by this command: 我正在通过以下命令在应用程序启动时注册一个dll:

System.Diagnostics.Process.Start("regsvr32",strPath);

and after running this line of code , a window appears that says DLL registration was successful or not . 运行这行代码后,将出现一个窗口,显示DLL注册成功与否。

My question is that how can I hide this window in my application? 我的问题是如何在应用程序中隐藏此窗口?

Use /s – Silent; display no message boxes (added with Windows XP and Windows Vista) 使用/s – Silent; display no message boxes (added with Windows XP and Windows Vista) /s – Silent; display no message boxes (added with Windows XP and Windows Vista) option. /s – Silent; display no message boxes (added with Windows XP and Windows Vista)选项。

Source: What is the different between /n and /i parameters of RegSvr32.exe? 来源: RegSvr32.exe的/ n和/ i参数之间有什么区别?

Process proc = new Process
{
    StartInfo =
    {
        FileName = "regsvr32",
        Arguments = "/s" + strPath,
        RedirectStandardError = true,
        UseShellExecute = false,
        CreateNoWindow = true
    }
};
proc.Start();

Also you can do this: 您也可以这样做:

System.Diagnostics.Process.Start("regsvr32","/s" + strPath);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM