locked
Process checking not working when the program is minimized to Tray RRS feed

  • Question

  • Hi

    I wrote code for checking whether a particular process (Outlook.exe, in my case) is running or not. It is working fine when the Outlook window is open or minimized. But, when the Outlook is minimized to tray (which on the right side of taskbar), my code is not identifying the process.

    Could anyone please suggest me a way to get the process of Outlook (or any other program) that is minimized to tray?

     

    Thanks in advance!


    Pranav Ainavolu
    Tuesday, September 21, 2010 11:50 AM

Answers

  • Hi, Pranav

    The process should exists no matter it was minimized or hidden in the tray.

     How do you identify the process?

    Here is the following code that identify the outlook process and enumerate all the process.

     

        Sub Main()

            Dim outLooKProcess() As Process = Process.GetProcessesByName("OUTLOOK.EXE")

            If outLooKProcess Is Nothing Then

                Console.WriteLine("Current outlook.exe is not Running")

            Else

                Console.WriteLine("OutLook.exe is running")

            End If

     

            Dim AllProcess() As Process = Process.GetProcesses()

            For Each p As Process In AllProcess

                Console.WriteLine(p.ProcessName)

            Next

     

    Please give me some feedback.

    Thanks

    Chao


    Please unmark it if it does not help, and mark it if it helps.
    • Marked as answer by Chao Kuo Tuesday, September 28, 2010 11:37 AM
    Monday, September 27, 2010 7:05 AM

All replies

  • Hi, Pranav

    The process should exists no matter it was minimized or hidden in the tray.

     How do you identify the process?

    Here is the following code that identify the outlook process and enumerate all the process.

     

        Sub Main()

            Dim outLooKProcess() As Process = Process.GetProcessesByName("OUTLOOK.EXE")

            If outLooKProcess Is Nothing Then

                Console.WriteLine("Current outlook.exe is not Running")

            Else

                Console.WriteLine("OutLook.exe is running")

            End If

     

            Dim AllProcess() As Process = Process.GetProcesses()

            For Each p As Process In AllProcess

                Console.WriteLine(p.ProcessName)

            Next

     

    Please give me some feedback.

    Thanks

    Chao


    Please unmark it if it does not help, and mark it if it helps.
    • Marked as answer by Chao Kuo Tuesday, September 28, 2010 11:37 AM
    Monday, September 27, 2010 7:05 AM
  • I wrote the same but used "OUTLOOK" instead of "OUTLOOK.EXE".

    Thanks Chao Kuo!

     

     


    Pranav Ainavolu
    Monday, September 27, 2010 12:13 PM