获取窗口标题 - GetWindowTitle
函数简介
获取窗口的标题。
接口名称
GetWindowTitle
DLL调用
long GetWindowTitle(long ola, long hwnd);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| hwnd | 长整数型 | 指定的窗口句柄。 |
示例
long ret = GetWindowTitle(instance, hwnd);
if (ret != 0) {
// 使用标题字符串
FreeStringPtr(ret);
}
返回值
字符串指针地址,包含窗口标题。返回 0 表示失败。
注意事项
- DLL调用返回字符串指针地址,需要调用 FreeStringPtr 接口释放内存。
