var WindowList: TList;function GetWindows( handle: HWND; // handle to parent window info: LPARAM // application-defined value ): Boolean; stdcall; begin {} Result := True; WindowList.Add(Pointer(handle)); end;function GetWinClass(whandle: HWnd): string; var i: integer; Dest: array [0..80] of char; begin Result := ''; WindowList := TList.Create(); EnumWindows(@GetWindows, 0); for i := 0 to WindowList.Count - 1 do if HWnd(WindowList[i]) = whandle then begin if GetClassName(Hwnd(WindowList[i]), Dest, Sizeof(Dest) - 1) > 0 then begin Result := Dest; Break; end; end; WindowList.Free(); end;
这样即可 function GetWinClass(whandle: HWnd): string; var i: integer; Dest: array [0..80] of char; begin Result := ''; if GetClassName(whandle, Dest, Sizeof(Dest) - 1) > 0 then begin Result := Dest; Break; end; end;
windows.GetClassName( ) 设置相应控件所有的属性值,is very difficult,but you can use api set visilbe, caption ,border, enabled property.
WindowList: TList;function GetWindows(
handle: HWND; // handle to parent window
info: LPARAM // application-defined value
): Boolean; stdcall;
begin {}
Result := True;
WindowList.Add(Pointer(handle));
end;function GetWinClass(whandle: HWnd): string;
var
i: integer;
Dest: array [0..80] of char;
begin
Result := '';
WindowList := TList.Create();
EnumWindows(@GetWindows, 0);
for i := 0 to WindowList.Count - 1 do
if HWnd(WindowList[i]) = whandle then
begin
if GetClassName(Hwnd(WindowList[i]), Dest, Sizeof(Dest) - 1) > 0 then
begin
Result := Dest;
Break;
end;
end;
WindowList.Free();
end;
function GetWinClass(whandle: HWnd): string;
var
i: integer;
Dest: array [0..80] of char;
begin
Result := '';
if GetClassName(whandle, Dest, Sizeof(Dest) - 1) > 0 then
begin
Result := Dest;
Break;
end;
end;
设置相应控件所有的属性值,is very difficult,but you can use api set visilbe, caption ,border, enabled property.