🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / C# RMOS / Process eğer gizli değilse gizler

1-) C# RMOS - Process eğer gizli değilse gizler

 

 private void timer1_Tick(object sender, EventArgs e) // interval 100 olarak ayarlı

        {

 

            try

            {

                List<Process> p = Process.GetProcessesByName("Sprint").ToList();

 

                foreach (var item in p)

                {

                    if (item != null && !item.MainWindowHandle.ToString().Equals("0")) // Sprint gizle

                    {

                        Console.WriteLine(item.MainWindowHandle.ToString());

 

                        IntPtr h = item.MainWindowHandle;

                        ShowWindow(h, SW_HIDE);

                    }

                }

 

            }

            catch (Exception ex)

            {

                RHMesaj.MyMessageError(MyClass, "timer1_Tick", "", ex);

            }

        }

 

        const int SW_HIDE = 0;

 

        [DllImport("user32.dll")]

        static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

 

 

 

-- ÇALIŞTIRMA ABBYFİNEREADER--

 

 public void abbyStart(string neyi, string files_id)

        {

            try

            {

                ProcessStartInfo startInfo = new ProcessStartInfo(dbtoolsDocx.abbyPath + "FineCmd.exe");

                startInfo.Arguments = neyi + @" /out " + tempPathTxt + @"\" + files_id + ".txt";

                Process processTemp = new Process();

                processTemp.StartInfo = startInfo;

                processTemp.Start();

            }

            catch (Exception ex)

            {

                RHMesaj.MyMessageError(MyClass, "abbyStart", "", ex);

            }

 

        }

 

 

-- PROGRAM YENİDEN BAŞLATILDIĞINDA AÇIK OLAN SPRİNTLERİ TEMİZLE --

 
public void abbyAllKill()

        {

            try

            {

                List<Process> p = Process.GetProcessesByName("Sprint").ToList();

                foreach (var item in p)

                {

                    item.Kill();

                }

            }

            catch (Exception ex)

            {

                RHMesaj.MyMessageError(MyClass, "abbyAllKill", "", ex);

            }

        }

 

 2021 Ocak 18 Pazartesi
 382