How can I obtain the program title under the "application" Panel in "Task Manager ??

Source: Internet
Author: User
How can I obtain the program title under the "application" Panel in "Task Manager ?? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061122142354184.html
For example, please help ~~~~
Please note that the Process List is not an application Program Title List :)

Easy to use WMI


Procedure tform1.formcreate (Sender: tobject );
Begin
Wlist: = tobjectlist. Create;
End;

Procedure tform1.formdestroy (Sender: tobject );
Begin
Wlist. Free;
End;

Function enumwindowproc (handle: hwnd; lparam: longint): bool; stdcall;
VaR
Info: twindowinfo;
S: string;
Begin
Info: = tsf-winfo. Create;
Info. Handle: = handle;
Setlength (seconds, 256 );
Getwindowtext (handle, pchar (s), 256 );
Info. Name: = s;
Info. dispstr: = 'handle: '+ inttohex (handle, 8) +', text: '+ S;
Tlist (lparam). Add (Info );
Result: = true;
End;

Procedure tform1.button1click (Sender: tobject );
VaR
I: integer;
Begin
Wlist. Clear;
Enumwindows (@ enumwindowproc, INTEGER (wlist ));
Listbox1.clear;
For I: = 0 to wlist. Count-1 do
Listbox1.items. Add (tw.winfo (wlist [I]). dispstr );
End;

Agree upstairs

Well, you guys, it's so simple and comprehensive that WMI doesn't work.

To maozefa (AFA ):
The program cannot run. The message "undeclared identifier: 'tobjectlist' is displayed'
In addition, tsf-winfo is only a struct. There is no. Create constructor ~~~
Help ~~~
Thank you ~~~

Uses
Contnrs;

Tsf-winfo = Class
Public
Handle: hwnd;
Name: string;
Dispstr: string;
End;

Wlist: tlist;

To maozefa (AFA ):
Oh, now the program can be executed, but it is not what I want, there are some useless names. What I want is the ones shown in the task manager ~~~~~ Let's take a look ~~~~~
//**********************//
Windows Task Manager
Automatic drop-down
Codeparamwindow
Codeparamwindow
Kingsoft bully 2006 (pause word extraction)
Sysfader
Sysfader
Sysfader
Sysfader
Shabout
Delphi 7
How can I obtain the program title under the "application" Panel in "Task Manager ?? -Windows Internet Explorer
Delphi 7
Delphi 7
Sendmessage-Microsoft Visual C ++-[SC. C]
Microsoft spy ++-[Windows 4]
Untitled-Notepad
Kibitzwindow
DBK
MCI Command Handling window
Miscellaneous
Activemovie window
Ddd
Acrobat iehelper
DDE Server window
Acrobat iehelper
DBK
Acrobat iehelper
Compressed package
MCI Command Handling window
MCI Command Handling window
DDE Server window
GDI + window
Delphi
C: \ windows \ system32 \ cmd.exe
Acrobat iehelper
Sysfader
Codeparamwindow
MCI Command Handling window
Acrobat iehelper
Thunder 5
MCI Command Handling window
DBK
Sysfader
DDE Server window
Electric Meter
Acrobat iehelper
MCI Command Handling window
MCI Command Handling window
Connections Tray
Ms_webcheckmonitor
Mediacenter
Nvsvcpmmwindowclass
Sysfader
Program Manager
//**********************//

Http://community.csdn.net/Expert/topic/4742/4742530.xml? Temp =. 8409998.

Let's take a look ~~~~

To sanmaotuo (laifeng ):
Well, I have never heard of WMI. What is it? For details, refer ~~~~

to liangqingzhi (Old One): Thanks for the solution. By the way, style: = getwindowlong (ahwnd, gwl_style ); what are the values of style in (similar to ws_popup )? Waiting for teaching ~~~~

It doesn't matter if there is no WMI. You can handle it like this. Pack you satisfied

VaR
_ Tasks: tasks;
Enum: ienumvariant;
Numelements: ulong;
_ Task: olevariant;
Begin
_ Tasks: = wordapplication. tasks;
Enum: = _ tasks. _ newenum as ienumvariant;
While succeeded (enum. Next (1, _ task, numelements) and (numelements> 0) Do
Begin
If (iunknown (_ task) as task). Visible then
Showmessage (iunknown (_ task) as task). Name );
End;

Best path.

It's easy for you to try this one.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.