先通过如下的过程取得相关对象的HANDLEvar
  hCurrentWindow: HWnd;
  szText: array[0..254] of char;
  i:integer;
begin
  i:=0;
  memo1.Lines.clear;
  Memo1.Lines.Add('序号'+chr(9)+'句柄'+chr(9)+'程序');
  while i<9000 do
  begin
    hCurrentWindow:=GetWindow(i, GW_HWNDNEXT);
    if GetWindowText(hcurrentwindow, @szText, 255)>0 then
      Memo1.Lines.Add(inttostr(Memo1.Lines.Count)+chr(9)+inttostr(i)+chr(9)+StrPas(@szText));
    inc(i);
  end;然后通过 postmessage 函数发系统消息,即可。