procedure TForm1.Button1Click(Sender: TObject); var i : integer; hdl : HWND; name : string; begin for i := 0 to ControlCount - 1 do if Controls[i] is TButton then begin name := TButton(controls[i]).Name; hdl := TButton(controls[i]).Handle; end;end;
呵呵,你是如何确定CCCC这个是你要的?
是其它程序的类名啊?我用SPY++看的啊
用Windows API 函数EnumChildWindows ,枚举出所有子窗口的句柄HWND,用GetClassName(HWND)
用Windows API 函数EnumChildWindows ,枚举出所有子窗口的句柄HWND,用GetClassName(HWND)
procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
hdl : HWND;
name : string;
begin
for i := 0 to ControlCount - 1 do
if Controls[i] is TButton then
begin
name := TButton(controls[i]).Name;
hdl := TButton(controls[i]).Handle;
end;end;
呵呵,你是如何确定CCCC这个是你要的?