The GetWindowText function copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied.
解决方案 »
- adoQuery的问题
- FileWrite与字符串指针
- 請問一下dbedit1的OnExit事件在什麽時候會觸發?
- 请问 Delphi 中联合查找的数据集可以修改字段值并提交吗
- BDE:query简单的显示问题
- 怎么检查时间的合法性如'2004-12-15 8:30:25'是一个时间,而'era12d34'不是一个时间。
- 关于Chart组件的简单问题,很容易的分的。
- 如何知道,端口上是否插上了软件狗?
- 关于含变量的查询,比较有挑战性,求助
- 想用DELPHI编写一个打开网页,同时可将网页另存的程序
- 如何在form的onshow事件里关闭该form?
- 推荐几本有深度的DELPHI书吧?市面上书的怎么都一个模子刻出来的呀!!!
GetWindowText参数如下
int GetWindowText( HWND hWnd, // 控件的句柄
LPTSTR lpString, // 缓冲区指针
int nMaxCount // 需要的文字最大长度
);
返回值为获取的长度
文字长度可以使用如下API获取:
int GetWindowTextLength( HWND hWnd // handle of window or control with text
);
返回值为文字长度.
例如这样就把szText复制为控件的文字.
GetWindowText(
controlhWnd
,szText
,GetWindowTextLength( controlhWnd)
);