Пример #1
0
        public bool StartStreamingPlay(String filePath, IPAddress srvIP, UInt32 srvPort)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return(false);
                }

                UInt32  ctrlID = 0;
                ErrCode err    = CommonManager.CreateSrvCtrl().SendNwPlayOpen(filePath, ref ctrlID);
                if (err != ErrCode.CMD_SUCCESS)
                {
                    MessageBox.Show(CommonManager.GetErrCodeText(err) ?? "まだ録画が開始されていません。");
                    return(false);
                }

                OpenTVTest(Settings.Instance.TvTestOpenWait, "TvTest");
                var cmdTvTest = new CtrlCmdUtil();
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + process.Id, "TvTest_Ctrl_BonPipe_" + process.Id);
                cmdTvTest.SetConnectTimeOut(1000);

                UInt32 ip = 0x7F000001;
                if (srvIP != null && srvIP.GetAddressBytes().Length == 4)
                {
                    byte[] oct = srvIP.GetAddressBytes();
                    ip = (uint)oct[0] << 24 | (uint)oct[1] << 16 | (uint)oct[2] << 8 | oct[3];
                }

                TVTestStreamingInfo sendInfo = new TVTestStreamingInfo();
                sendInfo.enableMode = 1;
                sendInfo.ctrlID     = ctrlID;
                sendInfo.serverIP   = ip;
                sendInfo.serverPort = srvPort;

                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                for (int i = 0; i < 10 && cmdTvTest.SendViewSetStreamingInfo(sendInfo) != ErrCode.CMD_SUCCESS; i++)
                {
                    System.Threading.Thread.Sleep(1000);
                }

                WakeupWindow(process.MainWindowHandle);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return(true);
        }
Пример #2
0
 /// <summary>ストリーミング配信制御IDの設定</summary>
 public ErrCode SendViewSetStreamingInfo(TVTestStreamingInfo val)
 {
     return(SendCmdData(CtrlCmd.CMD_VIEW_APP_TT_SET_CTRL, val));
 }
Пример #3
0
        public bool StartStreamingPlay(string filePath, uint reserveID)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return(false);
                }
                if (CommonManager.Instance.NWMode == false)
                {
                    if (IniFileHandler.GetPrivateProfileInt("SET", "EnableTCPSrv", 0, SettingPath.TimerSrvIniPath) == 0)
                    {
                        MessageBox.Show("動作設定でネットワーク接続を許可する必要があります。");
                        return(false);
                    }
                }
                var sendInfo = new TVTestStreamingInfo();
                if (filePath == null)
                {
                    var     playInfo = new NWPlayTimeShiftInfo();
                    ErrCode err      = CommonManager.CreateSrvCtrl().SendNwTimeShiftOpen(reserveID, ref playInfo);
                    if (err != ErrCode.CMD_SUCCESS)
                    {
                        MessageBox.Show(CommonManager.GetErrCodeText(err) ?? "まだ録画が開始されていません。");
                        return(false);
                    }
                    sendInfo.ctrlID   = playInfo.ctrlID;
                    sendInfo.filePath = playInfo.filePath;
                }
                else
                {
                    ErrCode err = CommonManager.CreateSrvCtrl().SendNwPlayOpen(filePath, ref sendInfo.ctrlID);
                    if (err != ErrCode.CMD_SUCCESS)
                    {
                        MessageBox.Show(CommonManager.GetErrCodeText(err) ?? "ファイルを開けませんでした。");
                        return(false);
                    }
                }

                OpenTVTest(1000, false);
                var cmdTvTest = new CtrlCmdUtil();
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + process.Id, "TvTest_Ctrl_BonPipe_" + process.Id);
                cmdTvTest.SetConnectTimeOut(1000);

                sendInfo.enableMode = 1;
                if (CommonManager.Instance.NWMode == false)
                {
                    sendInfo.serverIP = 0x7F000001;
                    // 原作はここで自ホスト名を取得して解決したアドレスを格納している。(ないとは思うが)不具合があれば戻すこと
                    sendInfo.serverPort = (UInt32)IniFileHandler.GetPrivateProfileInt("SET", "TCPPort", 4510, SettingPath.TimerSrvIniPath);
                }
                else
                {
                    sendInfo.serverIP = 0x7F000001;
                    IPAddress srvIP = CommonManager.Instance.NWConnectedIP;
                    if (srvIP != null && srvIP.GetAddressBytes().Length == 4)
                    {
                        byte[] oct = srvIP.GetAddressBytes();
                        sendInfo.serverIP = (uint)oct[0] << 24 | (uint)oct[1] << 16 | (uint)oct[2] << 8 | oct[3];
                    }
                    sendInfo.serverPort = CommonManager.Instance.NWConnectedPort;
                }
                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                for (int i = 0; i < 10 && cmdTvTest.SendViewSetStreamingInfo(sendInfo) != ErrCode.CMD_SUCCESS; i++)
                {
                    System.Threading.Thread.Sleep(1000);
                }

                WakeupWindow(process.MainWindowHandle);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return(true);
        }
Пример #4
0
        public bool StartStreamingPlay(String filePath, String srvIP, UInt32 srvPort)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return(false);
                }

                UInt32 ctrlID = 0;
                UInt32 err    = cmd.SendNwPlayOpen(filePath, ref ctrlID);
                if (err == 205)
                {
                    MessageBox.Show("サーバーに接続できませんでした");
                    return(false);
                }
                else if (err != 1)
                {
                    MessageBox.Show("まだ録画が開始されていません");
                    return(false);
                }

                if (IsOpenTVTest() == false)
                {
                    processID = FindTVTestProcess();
                    if (processID == -1)
                    {
                        Process process;
                        process   = System.Diagnostics.Process.Start(Settings.Instance.TvTestExe, Settings.Instance.TvTestCmd);
                        processID = process.Id;
                        System.Threading.Thread.Sleep(Settings.Instance.TvTestOpenWait);
                    }
                }
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + processID.ToString(), "\\\\.\\pipe\\TvTest_Ctrl_BonPipe_" + processID.ToString());
                cmdTvTest.SetConnectTimeOut(1000);

                UInt32 ip    = 0;
                Int32  shift = 24;
                //srvIP = CommonManager.Instance.NW.ConnectedIP;
                foreach (IPAddress address in Dns.GetHostAddresses(srvIP))
                {
                    srvIP = address.ToString();
                }

                foreach (string word in srvIP.Split('.'))
                {
                    ip    |= Convert.ToUInt32(word) << shift;
                    shift -= 8;
                }

                TVTestStreamingInfo sendInfo = new TVTestStreamingInfo();
                sendInfo.enableMode = 1;
                sendInfo.ctrlID     = ctrlID;
                sendInfo.serverIP   = ip;
                sendInfo.serverPort = srvPort;

                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                if (cmdTvTest.SendViewSetStreamingInfo(sendInfo) != 1)
                {
                    System.Threading.Thread.Sleep(5 * 1000);
                    cmdTvTest.SendViewSetStreamingInfo(sendInfo);
                }

                WakeupWindow(processID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return(true);
        }
Пример #5
0
        public bool StartTimeShift(UInt32 reserveID)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return(false);
                }
                if (CommonManager.Instance.NWMode == false)
                {
                    if (IniFileHandler.GetPrivateProfileInt("SET", "EnableTCPSrv", 0, SettingPath.TimerSrvIniPath) == 0)
                    {
                        MessageBox.Show("追っかけ再生を行うには、動作設定でネットワーク接続を許可する必要があります。");
                        return(false);
                    }
                }
                NWPlayTimeShiftInfo playInfo = new NWPlayTimeShiftInfo();
                UInt32 err = cmd.SendNwTimeShiftOpen(reserveID, ref playInfo);
                if (err == 205)
                {
                    MessageBox.Show("サーバーに接続できませんでした");
                    return(false);
                }
                else if (err != 1)
                {
                    MessageBox.Show("まだ録画が開始されていません");
                    return(false);
                }

                if (IsOpenTVTest() == false)
                {
                    processID = FindTVTestProcess();
                    if (processID == -1)
                    {
                        Process process;
                        process   = System.Diagnostics.Process.Start(Settings.Instance.TvTestExe, Settings.Instance.TvTestCmd);
                        processID = process.Id;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + processID.ToString(), "\\\\.\\pipe\\TvTest_Ctrl_BonPipe_" + processID.ToString());
                cmdTvTest.SetConnectTimeOut(1000);

                TVTestStreamingInfo sendInfo = new TVTestStreamingInfo();
                sendInfo.enableMode = 1;
                sendInfo.ctrlID     = playInfo.ctrlID;
                if (CommonManager.Instance.NWMode == false)
                {
                    sendInfo.serverIP = 0x7F000001;

                    string      hostname = Dns.GetHostName();
                    IPAddress[] adrList  = Dns.GetHostAddresses(hostname);
                    foreach (IPAddress address in adrList)
                    {
                        if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                        {
                            UInt32 ip    = 0;
                            Int32  shift = 24;
                            foreach (string word in address.ToString().Split('.'))
                            {
                                ip    |= Convert.ToUInt32(word) << shift;
                                shift -= 8;
                            }
                            sendInfo.serverIP = ip;
                            break;
                        }
                    }

                    sendInfo.serverPort = (UInt32)IniFileHandler.GetPrivateProfileInt("SET", "TCPPort", 4510, SettingPath.TimerSrvIniPath);
                }
                else
                {
                    UInt32 ip    = 0;
                    Int32  shift = 24;
                    String srvIP = CommonManager.Instance.NW.ConnectedIP;
                    foreach (IPAddress address in Dns.GetHostAddresses(CommonManager.Instance.NW.ConnectedIP))
                    {
                        srvIP = address.ToString();
                    }
                    foreach (string word in srvIP.Split('.'))
                    {
                        ip    |= Convert.ToUInt32(word) << shift;
                        shift -= 8;
                    }
                    sendInfo.serverIP   = ip;
                    sendInfo.serverPort = CommonManager.Instance.NW.ConnectedPort;
                }
                sendInfo.filePath = playInfo.filePath;
                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                if (cmdTvTest.SendViewSetStreamingInfo(sendInfo) != 1)
                {
                    System.Threading.Thread.Sleep(5 * 1000);
                    cmdTvTest.SendViewSetStreamingInfo(sendInfo);
                }

                WakeupWindow(processID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return(true);
        }
Пример #6
0
        public bool StartTimeShift(UInt32 reserveID)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return false;
                }
                if (CommonManager.Instance.NWMode == false)
                {
                    if (IniFileHandler.GetPrivateProfileInt("SET", "EnableTCPSrv", 0, SettingPath.TimerSrvIniPath) == 0)
                    {
                        MessageBox.Show("追っかけ再生を行うには、動作設定でネットワーク接続を許可する必要があります。");
                        return false;
                    }
                }
                NWPlayTimeShiftInfo playInfo = new NWPlayTimeShiftInfo();
                UInt32 err = cmd.SendNwTimeShiftOpen(reserveID, ref playInfo);
                if (err == 205)
                {
                    MessageBox.Show("サーバーに接続できませんでした");
                    return false;
                }
                else if( err != 1 )
                {
                    MessageBox.Show("まだ録画が開始されていません");
                    return false;
                }

                if (IsOpenTVTest() == false)
                {
                    processID = FindTVTestProcess();
                    if (processID == -1)
                    {
                        Process process;
                        process = System.Diagnostics.Process.Start(Settings.Instance.TvTestExe, Settings.Instance.TvTestCmd);
                        processID = process.Id;
                        System.Threading.Thread.Sleep(1000);
                    }
                }
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + processID.ToString(), "\\\\.\\pipe\\TvTest_Ctrl_BonPipe_" + processID.ToString());
                cmdTvTest.SetConnectTimeOut(1000);

                TVTestStreamingInfo sendInfo = new TVTestStreamingInfo();
                sendInfo.enableMode = 1;
                sendInfo.ctrlID = playInfo.ctrlID;
                if (CommonManager.Instance.NWMode == false)
                {
                    sendInfo.serverIP = 0x7F000001;

                    string hostname = Dns.GetHostName();
                    IPAddress[] adrList = Dns.GetHostAddresses(hostname);
                    foreach (IPAddress address in adrList)
                    {
                        if (address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                        {
                            UInt32 ip = 0;
                            Int32 shift = 24;
                            foreach (string word in address.ToString().Split('.'))
                            {
                                ip |= Convert.ToUInt32(word) << shift;
                                shift -= 8;
                            }
                            sendInfo.serverIP = ip;
                            break;
                        }
                    }

                    sendInfo.serverPort = (UInt32)IniFileHandler.GetPrivateProfileInt("SET", "TCPPort", 4510, SettingPath.TimerSrvIniPath);
                }
                else
                {
                    UInt32 ip = 0;
                    Int32 shift = 24;
                    String srvIP = CommonManager.Instance.NW.ConnectedIP;
                    foreach (IPAddress address in Dns.GetHostAddresses(CommonManager.Instance.NW.ConnectedIP))
                    {
                        srvIP = address.ToString();
                    }
                    foreach (string word in srvIP.Split('.'))
                    {
                        ip |= Convert.ToUInt32(word) << shift;
                        shift -= 8;
                    }
                    sendInfo.serverIP = ip;
                    sendInfo.serverPort = CommonManager.Instance.NW.ConnectedPort;
                }
                sendInfo.filePath = playInfo.filePath;
                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                if (cmdTvTest.SendViewSetStreamingInfo(sendInfo) != 1)
                {
                    System.Threading.Thread.Sleep(5 * 1000);
                    cmdTvTest.SendViewSetStreamingInfo(sendInfo);
                }

                WakeupWindow(processID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return true;
        }
Пример #7
0
        public bool StartStreamingPlay(String filePath, String srvIP, UInt32 srvPort)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return false;
                }

                UInt32 ctrlID = 0;
                UInt32 err = cmd.SendNwPlayOpen(filePath, ref ctrlID);
                if (err == 205)
                {
                    MessageBox.Show("サーバーに接続できませんでした");
                    return false;
                }
                else if (err != 1)
                {
                    MessageBox.Show("まだ録画が開始されていません");
                    return false;
                }

                if (IsOpenTVTest() == false)
                {
                    processID = FindTVTestProcess();
                    if (processID == -1)
                    {
                        Process process;
                        process = System.Diagnostics.Process.Start(Settings.Instance.TvTestExe, Settings.Instance.TvTestCmd);
                        processID = process.Id;
                        System.Threading.Thread.Sleep(Settings.Instance.TvTestOpenWait);
                    }
                }
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + processID.ToString(), "\\\\.\\pipe\\TvTest_Ctrl_BonPipe_" + processID.ToString());
                cmdTvTest.SetConnectTimeOut(1000);

                UInt32 ip = 0;
                Int32 shift = 24;
                //srvIP = CommonManager.Instance.NW.ConnectedIP;
                foreach (IPAddress address in Dns.GetHostAddresses(srvIP))
                {
                    srvIP = address.ToString();
                }

                foreach (string word in srvIP.Split('.'))
                {
                    ip |= Convert.ToUInt32(word) << shift;
                    shift -= 8;
                }

                TVTestStreamingInfo sendInfo = new TVTestStreamingInfo();
                sendInfo.enableMode = 1;
                sendInfo.ctrlID = ctrlID;
                sendInfo.serverIP = ip;
                sendInfo.serverPort = srvPort;

                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                if (cmdTvTest.SendViewSetStreamingInfo(sendInfo) != 1)
                {
                    System.Threading.Thread.Sleep(5 * 1000);
                    cmdTvTest.SendViewSetStreamingInfo(sendInfo);
                }

                WakeupWindow(processID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return true;
        }
Пример #8
0
        public bool StartTimeShift(UInt32 reserveID)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return false;
                }
                if (CommonManager.Instance.NWMode == false)
                {
                    if (IniFileHandler.GetPrivateProfileInt("SET", "EnableTCPSrv", 0, SettingPath.TimerSrvIniPath) == 0)
                    {
                        MessageBox.Show("追っかけ再生を行うには、動作設定でネットワーク接続を許可する必要があります。");
                        return false;
                    }
                }
                NWPlayTimeShiftInfo playInfo = new NWPlayTimeShiftInfo();
                ErrCode err = cmd.SendNwTimeShiftOpen(reserveID, ref playInfo);
                if (err == ErrCode.CMD_ERR_CONNECT)
                {
                    MessageBox.Show("サーバーに接続できませんでした");
                    return false;
                }
                else if( err != ErrCode.CMD_SUCCESS )
                {
                    MessageBox.Show("まだ録画が開始されていません");
                    return false;
                }

                OpenTVTest(1000, "TvTest");
                var cmdTvTest = new CtrlCmdUtil();
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + process.Id, "\\\\.\\pipe\\TvTest_Ctrl_BonPipe_" + process.Id);
                cmdTvTest.SetConnectTimeOut(1000);

                TVTestStreamingInfo sendInfo = new TVTestStreamingInfo();
                sendInfo.enableMode = 1;
                sendInfo.ctrlID = playInfo.ctrlID;
                if (CommonManager.Instance.NWMode == false)
                {
                    sendInfo.serverIP = 0x7F000001;
                    // 原作はここで自ホスト名を取得して解決したアドレスを格納している。(ないとは思うが)不具合があれば戻すこと
                    sendInfo.serverPort = (UInt32)IniFileHandler.GetPrivateProfileInt("SET", "TCPPort", 4510, SettingPath.TimerSrvIniPath);
                }
                else
                {
                    sendInfo.serverIP = 0x7F000001;
                    IPAddress srvIP = CommonManager.Instance.NW.ConnectedIP;
                    if (srvIP != null && srvIP.GetAddressBytes().Length == 4)
                    {
                        byte[] oct = srvIP.GetAddressBytes();
                        sendInfo.serverIP = (uint)oct[0] << 24 | (uint)oct[1] << 16 | (uint)oct[2] << 8 | oct[3];
                    }
                    sendInfo.serverPort = CommonManager.Instance.NW.ConnectedPort;
                }
                sendInfo.filePath = playInfo.filePath;
                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                for (int i = 0; i < 10 && cmdTvTest.SendViewSetStreamingInfo(sendInfo) != ErrCode.CMD_SUCCESS; i++)
                {
                    System.Threading.Thread.Sleep(1000);
                }

                WakeupWindow(process.MainWindowHandle);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return true;
        }
Пример #9
0
        public bool StartStreamingPlay(String filePath, IPAddress srvIP, UInt32 srvPort)
        {
            try
            {
                if (Settings.Instance.TvTestExe.Length == 0)
                {
                    MessageBox.Show("TVTest.exeのパスが設定されていません");
                    return false;
                }

                UInt32 ctrlID = 0;
                ErrCode err = cmd.SendNwPlayOpen(filePath, ref ctrlID);
                if (err == ErrCode.CMD_ERR_CONNECT)
                {
                    MessageBox.Show("サーバーに接続できませんでした");
                    return false;
                }
                else if (err != ErrCode.CMD_SUCCESS)
                {
                    MessageBox.Show("まだ録画が開始されていません");
                    return false;
                }

                OpenTVTest(Settings.Instance.TvTestOpenWait, "TvTest");
                var cmdTvTest = new CtrlCmdUtil();
                cmdTvTest.SetPipeSetting("Global\\TvTest_Ctrl_BonConnect_" + process.Id, "\\\\.\\pipe\\TvTest_Ctrl_BonPipe_" + process.Id);
                cmdTvTest.SetConnectTimeOut(1000);

                UInt32 ip = 0x7F000001;
                if (srvIP != null && srvIP.GetAddressBytes().Length == 4)
                {
                    byte[] oct = srvIP.GetAddressBytes();
                    ip = (uint)oct[0] << 24 | (uint)oct[1] << 16 | (uint)oct[2] << 8 | oct[3];
                }

                TVTestStreamingInfo sendInfo = new TVTestStreamingInfo();
                sendInfo.enableMode = 1;
                sendInfo.ctrlID = ctrlID;
                sendInfo.serverIP = ip;
                sendInfo.serverPort = srvPort;

                if (Settings.Instance.NwTvModeUDP == true)
                {
                    sendInfo.udpSend = 1;
                }
                if (Settings.Instance.NwTvModeTCP == true)
                {
                    sendInfo.tcpSend = 1;
                }
                for (int i = 0; i < 10 && cmdTvTest.SendViewSetStreamingInfo(sendInfo) != ErrCode.CMD_SUCCESS; i++)
                {
                    System.Threading.Thread.Sleep(1000);
                }

                WakeupWindow(process.MainWindowHandle);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
            return true;
        }