简体   繁体   中英

Invoke UI application in a thread

I've 2 exe (A, B) and one dll (C).

A is an exe that user invokes from commandline with argument -ui or -file_path.

if -ui is passed: B is used to show UI. if -file_path is passed, C is used for further functionality.

if -ui is passed, i use following code (in Main method):

 System.Threading.Thread a = new System.Threading.Thread(yah);
 a.Start();

 static void yah()
 {
     SyngoViaInstallerUI.Program.Main();
 }

but it blocks the command line from where exe A was invoked. is it possible to unblock the cmdLine or i should to create a new process for -ui argument?

Thanks.

您必须为B创建单独的流程才能释放流程A并正常完成。

Following code works, but is this correct way?

System.Diagnostics.Process pr = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
psi.FileName = @"file_path";
pr.StartInfo = psi;
pr.Start();

Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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