当前位置: 首页>>代码示例>>C#>>正文


C# MainForm.minimizeWindow方法代码示例

本文整理汇总了C#中MainForm.minimizeWindow方法的典型用法代码示例。如果您正苦于以下问题:C# MainForm.minimizeWindow方法的具体用法?C# MainForm.minimizeWindow怎么用?C# MainForm.minimizeWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MainForm的用法示例。


在下文中一共展示了MainForm.minimizeWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LaunchGame


//.........这里部分代码省略.........
                                fass.FileName = "ts3client_win32.exe";

                            var process = new Process();
                            process.StartInfo = fass;

                            process.Start();
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                    else
                        MessageBox.Show("TeamSpeak directory doesn't exist or executable not there. Please check your TeamSpeak directory and try again.", "Missing directory or file", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                Process[] pname = Process.GetProcessesByName("steam");
                if (pname.Length == 0)
                {
                    try
                    {
                        Status.Text = "Starting Steam...";

                        var fass = new ProcessStartInfo();
                        fass.WorkingDirectory = (string)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Valve\Steam", "SteamPath", "").ToString().Replace(@"/", @"\") + @"\";
                        fass.FileName = "steam.exe";
                        fass.Arguments = Arguments;

                        var process = new Process();
                        process.StartInfo = fass;
                        process.Start();
                        Thread.SpinWait(2000);
                        Thread.Sleep(2000);
                    }
                    catch { }
                }

            }
            else
            {
                SvArguments = "-port=" + serverInfo[1] + " \"-config=" + GameFolder + "TADST\\PTrdefault\\TADST_config.cfg\" \"-cfg=" + GameFolder + "TADST\\PTrdefault\\TADST_basic.cfg\" \"-profiles=" + GameFolder + "TADST\\PTrdefault\" -name=PTrdefault " + Arguments;
                HcArguments = "-client -connect=localhost -port=" + serverInfo[1] + " -password=\"" + serverInfo[2] + "\" -profile=PTrHeadlessClient -name=PTrHeadlessClient " + Arguments;
            }

            if (Directory.Exists(GameFolder) && File.Exists(GameFolder + GlobalVar.gameArtifact))
            {
                try
                {
                    string whatsRunning = "";
                    var gameProcessInfo = new ProcessStartInfo();
                    var hcProcessInfo = new ProcessStartInfo();
                    gameProcessInfo.WorkingDirectory = hcProcessInfo.WorkingDirectory = GameFolder;

                    if (GlobalVar.isServer)
                    {
                        gameProcessInfo.FileName = hcProcessInfo.FileName = "arma3server.exe";
                        gameProcessInfo.Arguments = SvArguments;
                        hcProcessInfo.Arguments = HcArguments;

                        var hcProcess = new Process();
                        hcProcess.StartInfo = hcProcessInfo;
                        hcProcess.Start();

                        whatsRunning = "Server";
                    }
                    else
                    {
                        gameProcessInfo.FileName = GlobalVar.gameArtifact;
                        gameProcessInfo.Arguments = "2 1 " + Arguments;

                        whatsRunning = "Game";
                    }

                    var gameProcess = new Process();
                    gameProcess.StartInfo = gameProcessInfo;
                    auxProcess = gameProcess;
                    gameProcess.Start();

                    Thread.Sleep(500);

                    GC.Collect();

                    Status.Text = whatsRunning + " running...";
                    mainForm.reSizeBarText(whatsRunning + "Running");
                    Launch.Enabled = false;
                    mainForm.minimizeWindow();
                    mainForm.Cursor = Cursors.Default;
                    waitEndGame.RunWorkerAsync();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                MessageBox.Show("Game directory doesn't exist or executable not there. Please check your Arma 3 directory and try again.", "Missing directory or file", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Launch.Enabled = true;
            }
        }
开发者ID:serialtasted,项目名称:arma3Launcher,代码行数:101,代码来源:LaunchCore.cs


注:本文中的MainForm.minimizeWindow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。