获取窗口标题 - GetWindowTitle
函数简介
获取窗口的标题
接口名称
GetWindowTitle
DLL调用
long GetWindowTitle(long ola, long hwnd)
参数定义:
ola
(长整型数): OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。hwnd
(长整型数): 指定的窗口句柄。
示例:
long titlePtr = GetWindowTitle(ola, hwnd);
if (titlePtr != 0) {
// 使用标题字符串
// ...
// 释放内存
FreeStringPtr(titlePtr);
}
COM调用
string GetWindowTitle(long hwnd)
参数定义:
hwnd
(长整型数): 指定的窗口句柄。
示例:
title = ola.GetWindowTitle(hwnd)
messagebox(title)
返回值
字符串:
- 返回窗口的标题字符串
注意:
- DLL调用返回字符串指针地址,需要调用 FreeStringPtr 接口释放内存