Mega Code Archive
List all applications from task manager applications
Title: list all applications from task manager applications
Question: How do i list all applications from task manager applications?
Not the all processes list, only the those from applications tab from task manager
Answer:
How do i list all applications from task manager applications?
Not the all processes list, only the those from applications tab from task manager
this is for all processes...
procedure TForm1.Button1Click(Sender: TObject);
var
hProcSnap: THandle;
pe32: TProcessEntry32;
Domain, User: string;
s: string;
begin
hProcSnap := CreateToolHelp32SnapShot(TH32CS_SNAPALL, 0);
if hProcSnap = INVALID_HANDLE_VALUE then Exit;
pe32.dwSize := SizeOf(ProcessEntry32);
if Process32First(hProcSnap, pe32) = True then
while Process32Next(hProcSnap, pe32) = True do
begin
if GetUserAndDomainFromPID(pe32.th32ProcessID, User, Domain) then
begin
s := Format('%s User: %s ; Domain: %s',[StrPas(pe32.szExeFile), User, Domain]);
Listbox1.Items.Add(s);
end else
Listbox1.Items.Add(StrPas(pe32.szExeFile));
end;
CloseHandle(hProcSnap);
end;
but how for only those from applications tab??