想要用params.WndParent,但是不知道怎么捕获没有标题栏的游戏窗体的句柄兄弟们帮忙啊另:游戏是一个朋友用VC写的,有源代码,是不是还有其他办法

解决方案 »

  1.   

    用EnumWindow枚举所有窗口试一试,记不清是不是这个这么写了,应该可以
      

  2.   

    果然是500分!
    应该在MS的MSDN上去找找看,肯定有方法可解
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Memo1: TMemo;
        Edit1: TEdit;
        Button1: TButton;
        Button2: TButton;
        Memo2: TMemo;
        find: TButton;
        Edit2: TEdit;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
        procedure findClick(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
     i:integer;
    begin
    {:=FindWindow(pchar(trim(edit1.Text)),nil);
    i:=getwindow( }
    i:=findwindow(nil,pchar(trim(edit1.Text)));
    memo1.Lines.Add(inttostr(i));
    end;procedure TForm1.Button2Click(Sender: TObject);
    var
       hCurrentWindow: HWnd;
       szText: array[0..254] of char;
    begin
         hCurrentWindow := GetWindow(Handle, GW_HWNDFIRST);
         while hCurrentWindow <> 0 do
         begin
            memo2.Lines.Add(inttostr(hCurrentWindow));
            if iswindowvisible(hCurrentWindow) then
            begin
    if GetWindowText(hCurrentWindow, @szText, 255)>0 then
        memo1.Lines.Add(StrPas(@szText));
            end;        
            hCurrentWindow:=GetWindow(hCurrentWindow, GW_HWNDNEXT);
         end;
    end;procedure TForm1.findClick(Sender: TObject);
    var
      i:integer;
    begin
      for i:=0 to memo2.Lines.Count -1 do begin  end;
    end;end.