Syntax
FindWindow(
lpClassName: PChar; {a pointer to a null terminated class name string}
lpWindowName: PChar {a pointer to a null terminated window name string}
): HWND; {returns a handle to a window}
example:
//the window explorer program must be running in a non-minimized state before
//this example will work
procedure TForm1.Button1Click(Sender: TObject);
var
  TheWindow: HWND;
begin
  //find a handle to the Windows Explorer window 
  Thewindow := FindWindow('ExplorerWClass',nil);
  //bring it to the top
  BringWindowToTop(TheWindow);
end;三少 :o)

解决方案 »

  1.   

    该函数可对窗口类进行查找,如成功则返回窗口句柄。
    参数:1.lpclassName:类名;可通过winsight32来查找。
          2.lpwindowname:标题;
    for example:
       hWnd:THandle;
      hWnd:=FindWindow(nil,windowsname);
       if hWnd<>0 then
          ......
       else
          ......
      

  2.   

    FindWindow(应用程序类名,窗口标题);
    应用程序类名如果不大知道的话可以用VC++里的SPY++找到类名,至于窗口标题一看便知啦
      

  3.   


    若是查找子窗体就还用用:
    FindWindowEx(  Parent: HWND; {a handle to a parent window}
                   Child: HWND; {a handle to a child window}
                   ClassName: PChar; {a pointer to a null terminated class name string}
                   WindowName: PChar {a pointer to a null terminated window name string}
                ): HWND;
    procedure TForm1.Button1Click(Sender: TObject);
    var
       AHwnd: HWND;
       WindowText: array[0..255] of char;
    begin
      AHwnd:= FindWindow('AClass',nil);
      { find a TEdit child window }
      AHwnd:=FindWindowEx(AHwnd, 0, 'TEdit',nil); 
      GetWindowText(AHwnd, WindowText, 255);
      Label1.Caption:=WindowText;
    end;