1、WinAPI: GetWindowText - 获取窗口标题 //声明:GetWindowText( hWnd: HWND; {窗口句柄} lpString: PChar; {接收文本的缓冲区的指针} nMaxCount: Integer {指定缓冲区大小, 其中包含NULL字符; 如果文本超出,会被被截断}): Integer; {返回字符个数, 不包括中断的空字符; 如果标题为空或句柄无效, 则返回零} --------------------------------------------------------------------------------//举例:var arr: array[0..254] of Char;begin GetWindowText(Handle, @arr, SizeOf(arr)); ShowMessage(arr); {Form1}end;--------------------------------------------------------------------------------//标题文本个数:var arr: array[0..254] of Char; num: Integer;begin num := GetWindowText(Handle, arr, SizeOf(arr)); ShowMessage(IntToStr(num)); {5}end;--------------------------------------------------------------------------------2、WinAPI: SetWindowText - 设置窗口标题 //声明:SetWindowText( hWnd: HWND; {窗口句柄} lpString: PChar {新标题串指针}): BOOL;--------------------------------------------------------------------------------//举例:var s: string;begin s := '新标题'; SetWindowText(Handle, PAnsiChar(s));end;--------------------------------------------------------------------------------