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