GetWindowText
GetWindowText是一款十分实用的可以帮你提取windows窗口中不能复制的文字的读取窗口文本。GetWindowText 美中不足的地方是不可以复制灰色按钮和某些下拉选项上的文字,其他的都过得去。
|
软件语言:简体中文
|
软件授权:免费
|
|
适用系统:Windows
|
创建时间:2020-12-11 |
|
软件厂商/开发者信息: -
|
|
资讯 更多
- GetWindowText v3.8.1.0 官方版更新 2020-09-11
函数功能
该函数将指定窗口的标题条文本(如果存在)拷贝到一个缓存区内。如果指定的窗口是一个控件,则拷贝控件的文本。但是,GetWindowText 可能无法获取外部应用程序中控件的文本,获取自绘的控
件或者是外部的密码编辑框很有可能会失败。
函数原型:Int GetWindowText(HWND hWnd,LPTSTR lpString,Int nMaxCount);
参数
hWnd:带文本的窗口或控件的句柄。
lpString:指向接收文本的缓冲区的指针。
nMaxCount:指定要保存在缓冲区内的字符的最大个数,其中包含 NULL 字符。如果文本超过界限,它就被截断。
getwindowtext 的 DELPHI 例子:
var
p:pchar;
begin
getmem(p,255);
getwindowtext(application.Handle,p,255);
showmessage(strpas(p));
freemem(p);
end;
返回值
如果函数成功,返回值是拷贝的字符串的字符个数,不包括中断的空字符;如果窗口无标题栏或文本,或标题栏为空,或窗口或控制的句柄无效,则返回值为零。若想获得更多错误信息,请调用 GetLastError 函数。
函数不能返回在其他应用程序中的编辑控件的文本。
备注
函数定义
如果目标窗口属于当前进程,GetWindowText 函数给指定的窗口或控件发送 WM_GETTEXT 消息。如果目标窗口属于其他进程,并且有一个窗口标题,则 GetWindowText 返回窗口的标题文本,如果窗口无标题,则函数返回空字符串。
速查:Windows NT:3.1 以上版本;Windows:95 以上版本:Windows CE:1.0 以上版本;头文件:Winuser.h;库文件:user32.lib:Unicode:在 Windows NT 上实现为 Unicode 和 ANSI 两种版本。
intGetWindowText(
LPTSTR lpszStringBuf,
int nMaxCount
) const;
voidGetWindowText(
CString& rString
) const;
Parameters 参数
lpszStringBuf
[out] Pointer to the buffer that will receive the text. If the string is as long or longer than the buffer, the string is truncated and terminated with a NULL character.
nMaxCount
[in] Specifies the maximum number of characters to copy to the buffer, including the NULL character. If the text exceeds this limit, it is truncated.
rString
A CString object that is to receive the copied string of the window's title.
Return Value 返回值
Specifies the length, in characters, of the copied string, not including the terminating null character. It is 0 if CWnd has no caption or if the caption is empty.
Remarks
If the CWnd object is a control, the GetWindowText member function copies the text within the control instead of copying the caption.
This member function causes the WM_GETTEXT message to be sent to the CWnd object.
简单使用:
定义 CString str ;
GetDlgItem(控件 ID)->GetWindowText(str);
这样 str 中就保存了 获取到的字符
版本列表
-
-
-
提取Windows窗口文字 v3.88 绿色免费版
GetWindowText 可以快速提取窗体中的文字,只需你把图标拖动到相应位置。比 ...
软件大小:148.0 KB 更新时间:2022-03-15
-
-
-
-
GetWindowText v3.88 官方版
GetWindowText 是一个小巧便携的窗口文本阅读器,使你能够查看窗口文本。只 ...
软件大小:150.0 KB 更新时间:2021-09-12
-
-
-
-
GetWindowText v3.8.1.0 官方版
GetWindowText是一款提取windows窗口中不能复制的文字的读取窗口文本 ...
软件大小:47.7 KB 更新时间:2020-09-11
-
-
-
-
GetWindowText 64位 v3.8.1.0 官方版
GetWindowText是一款十分实用的可以帮你提取windows窗口中不能复制的 ...
软件大小:99.2 KB 更新时间:2020-09-11
-
