none
Opened windows list RRS feed

  • Question

  • I want to get information of all open windows in my display screen, their stutus whether minimized or maximized, and if window is maximized then its location on screen, 

    i'm going through step by step so , first i need to get detial of All open/running application in my windows. all these processes i want to do via code instead of any tool.. 

    Monday, December 7, 2015 10:38 AM

Answers

  • Hi Ahmed Nafees Abbasi,

    >>first I need to get detail of All open/running application in my windows. all these processes i want to do via code instead of any tool.. 

    The following code is retrieve the titles of all open windows.

    Process[] processlist = Process.GetProcesses();
    
                foreach (Process process in processlist)
                {
                    if (!String.IsNullOrEmpty(process.MainWindowTitle))
                    {
                        Console.WriteLine("Process: {0} ID: {1} Window title: {2}", process.ProcessName, process.Id, process.MainWindowTitle);
                    }
                }

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 8, 2015 2:01 AM

All replies

  • Hi Ahmed Nafees Abbasi,

    >>first I need to get detail of All open/running application in my windows. all these processes i want to do via code instead of any tool.. 

    The following code is retrieve the titles of all open windows.

    Process[] processlist = Process.GetProcesses();
    
                foreach (Process process in processlist)
                {
                    if (!String.IsNullOrEmpty(process.MainWindowTitle))
                    {
                        Console.WriteLine("Process: {0} ID: {1} Window title: {2}", process.ProcessName, process.Id, process.MainWindowTitle);
                    }
                }

    Best regards,

    Kristin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 8, 2015 2:01 AM
  • I'd try Platform Invoke on EnumWindows and GetWindowText. That should find all the top-level windows of Win32 desktop applications, rather than only one per process. I don't know whether Process.MainWindowTitle supports Windows Store applications better, though.

    Monday, December 14, 2015 2:53 PM