Page 1 of 1

retrieving all processes running on computer

Posted: 12 Dec 2021 1:58
by daveplummermd
Hello. Is there a predicate or function that can retrieve all the programs and processes running on the host computer?
I have been using this code to retrieve an slist of the window titles, but some processes of course don't have windows or windows with titles.

Code: Select all

gui::getScreenWindow() = Screen,         Screen:getChildWindows() = WindowList,         list::getMember_nd(WindowList) = Win,         Win:gettext() = Text,
Thanks in advance.

Re: retrieving all processes running on computer

Posted: 13 Dec 2021 10:37
by Thomas Linder Puls
Microsoft gives this method: Enumerating All Processes.

But Visual Prolog does not contain bindings to these API's: EnumProcesses, EnumProcessModules and GetModuleBaseName. So you would have to make these yourself.

Also notice that enumerating processes is not exact, because processes come and go. Also notice that processes is not the same as programs: An Edge (or Chrome) browser can for example have 10 processes with just one window on the screen.