如题,请各位帮帮忙~~~~
请注意不是进程列表,是应用程序标题列表:)

解决方案 »

  1.   


    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 := TWindowInfo.Create;
      Info.Handle := Handle;
      SetLength(s, 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(TWindowInfo(WList[I]).DispStr);
    end;
      

  2.   

    呵呵,各位同志们,有那么简易全面好使的WMI你们怎么都不动容啊。
      

  3.   

    TO maozefa(阿发伯):
    程序无法运行,提示Undeclared identifier: 'TObjectList'
    而且TWindowInfo只是一个结构体而已阿,没有.create这个构造函数啊~~~
    帮忙~~~
    谢了先~~~
      

  4.   

    uses
      Contnrs;  TWindowInfo = class
      public
        Handle: HWND;
        Name: string;
        DispStr: string;
      end;
      

  5.   

    to maozefa(阿发伯):
    呵呵,现在程序可以执行了,但不是我要的效果,有一些没有用处的名称。我想要的就是在任务管理器中显示出来的那些,呵呵,帮帮忙~~~~~再看看~~~~~
    //**********************//
    Windows 任务管理器
    自动下拉
    CodeParamWindow
    CodeParamWindow
    金山词霸 2006(暂停取词)
    SysFader
    SysFader
    SysFader
    SysFader
    Shabout
    Delphi 7
    请教如何获得类似于“任务管理器”中“应用程序”面板下的程序标题?? - Windows Internet Explorer
    Delphi 7
    Delphi 7
    SendMessage - Microsoft Visual C++ - [sc.c]
    Microsoft Spy++ - [Windows 4]
    无标题 - 记事本
    KibitzWindow
    DBK
    MCI command handling window
    杂项
    ActiveMovie Window
    ddd
    Acrobat IEHelper
    DDE Server Window
    Acrobat IEHelper
    DBK
    Acrobat IEHelper
    压缩包
    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
    迅雷5
    MCI command handling window
    DBK
    SysFader
    DDE Server Window
    电表
    Acrobat IEHelper
    MCI command handling window
    MCI command handling window
    Connections Tray
    MS_WebcheckMonitor
    MediaCenter
    NVSVCPMMWindowClass
    SysFader
    Program Manager
    //**********************//
      

  6.   

    http://community.csdn.net/Expert/topic/4742/4742530.xml?temp=.8409998
      

  7.   

    to sanmaotuo(老冯):
    呵呵,没听过WMI啊,是什么东东?详细说一下呗~~~~
      

  8.   

    to liangqingzhi(老之): 谢谢了,解决,顺便问一下,Style:= GetWindowLong(aHWnd, GWL_STYLE); 中Style的值都包括什么啊(类似于WS_POPUP之类)?候教中~~~~
      

  9.   

    没有WMI没有关系,你这样处理。包你满意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;