cancel
Showing results for 
Search instead for 
Did you mean: 

Windows Task Manager - Get the Application Task Description?

Former Member
0 Kudos

Does anyone know of an example of getting the Application Task description from the Applications tab in the Task Manager?

As always thank you for your time!

Kyle

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kyle;

  Do you mean something like this ...

Regards ... Chris

Former Member
0 Kudos

Hi Chris,

Actually I was referring to this:

I have everything from the Processes tab, just trying to determine if it's available through the PSAPI API, just haven't had any luck finding the right method to get it out of there. 

Thanks again!

Former Member
0 Kudos

Yes, the ones that are bolded are Applications and the non-bolded ones are processes....

Former Member
0 Kudos

It looks like it is "File Description" from the exe file version info. I have an example that shows how to extract version info:

Topwiz Software - OSVersion

Former Member
0 Kudos

Chris,

Yes, that's what I am after, what API did you use to pull that?

Thanks,

Kyle

Former Member
0 Kudos

Hi Kyle;

  If you like ... send me an email and I can give you the download URL to my PowerBuilder System Explorer application example.  

Regards ... Chris

PS:  Chris at Travel-Net dot com

Former Member
0 Kudos

Thanks' Chris!

I tried "Chris at Travel-Net dot com" and "Chris dot Pollach at Travel-Net dot com"  but they bounced back as invalid addresses.  Not trying to be dense but where did I go wrong with the email address?

Former Member
0 Kudos

please use instead ... cpollach at travel-net dot com 

Former Member
0 Kudos

Beautiful Chris, a BIG thank you - exactly what I was looking for! 

Former Member
0 Kudos

That is Excellent news!  

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

There in an example comes with pb 12.6 code Examples.

See: Functions-- > External --- > Windows SDK Functions.

Open this example, and see the 'Tasks' button.

I hope it helps you.

Yosi

Former Member
0 Kudos

The following will return the exe filename of all the running processes. You should be able to use this as a jumping off point to return more information about the processes.

First you need this structure:

type processentry32 from structure

  unsignedlong dwsize

  unsignedlong cntusage

  unsignedlong th32processid

  unsignedlong th32defaultheapid

  unsignedlong th32moduleid

  unsignedlong cntthreads

  unsignedlong th32parentprocessid

  unsignedlong pcpriclassbase

  unsignedlong dwflags

  character szexefile[260]

end type

Then these external function declarations:

Function ulong CreateToolhelp32Snapshot ( &

  ulong dwFlags, ulong th32ProcessID ) Library "kernel32.dll"

Function boolean CloseHandle ( &

  ulong hObject ) Library "kernel32.dll"

Function boolean Process32First ( &

  ulong hSnapshot, Ref processentry32 lppe &

  ) Library "kernel32.dll" Alias For "Process32FirstW"

Function boolean Process32Next ( &

  ulong hSnapshot, Ref processentry32 lppe &

  ) Library "kernel32.dll" Alias For "Process32NextW"

Then this code:

Constant ULong TH32CS_SNAPPROCESS = 2

PROCESSENTRY32 lstr_pe32

ULong lul_SnapShot

String ls_ExeFile

lul_SnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)

If lul_SnapShot > 0 Then

  lstr_pe32.dwSize = 36 + (260 * 2)

  If Process32First(lul_SnapShot, lstr_pe32) Then

  Do

  If lstr_pe32.th32ProcessID > 0 Then

  ls_ExeFile = String(lstr_pe32.szExeFile)

  End If

  Loop While Process32Next(lul_SnapShot, lstr_pe32)

  End If

  CloseHandle(lul_SnapShot)

End If