locked
What is a APP (Task Manager)? RRS feed

  • Question

  • Hi,

    i try to build up for a project a simple task manager view, the offical windows task manager have a speration between app, backgroup processes and windows processes. I have found on Microsoft devblog (https://devblogs.microsoft.com/oldnewthing/20171219-00/?p=97606): If the process has a visible window, then Task Manager calls it an “App”.

    With the following code i catch all processes with a visible window:

    EnumWindows([](HWND hwnd, LPARAM lparam) -> BOOL {
         auto vi_list = reinterpret_cast<std::vector<DWORD>*>(lparam);
        DWORD dw_id;
        GetWindowThreadProcessId(hwnd, &dw_id);
         if ((bool)IsWindowVisible(hwnd)) {
             (*vi_list).push_back(dw_id);};
         return TRUE;
    }, LPARAM(&vi_win_list));

    If i make a short test (for example on firefox.exe), the task manager shows me 7 firefox.exe processes under apps and 3 firefox.exe process under background processes. In my test i have only one firefox.exe process (with a visible window) and 9 background processes. Is the information regarding apps sign wrong or my function?

    Saturday, January 11, 2020 7:39 PM

All replies

  • Hello,

    Thank you for posting here.

    The EnumWindows function does not enumerate child windows, with the exception of a few top-level windows owned by the system that have the WS_CHILD style.

    Further reading:https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows

    Is Firefox like multiple documents application in MFC? Different views are subwindows of the frame window.

    Best Regards,

    Suarez Zhou


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, January 13, 2020 7:39 AM