Discussions related to Visual Prolog
daveplummermd
VIP Member
Posts: 80
Joined: 18 Jul 2006 17:18

retrieving all processes running on computer

Unread post 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.
Dave Plummer
User avatar
Thomas Linder Puls
VIP Member
Posts: 1395
Joined: 28 Feb 2000 0:01

Re: retrieving all processes running on computer

Unread post 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.
Regards Thomas Linder Puls
PDC
Post Reply