获取到客户区域 - GetClientRect
函数简介
获取指定窗口的客户区域坐标,不包括标题栏、菜单栏、边框等非客户区。
接口名称
GetClientRect
DLL调用
int GetClientRect(long ola, long hwnd, int* x1, int* y1, int* x2, int* y2);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| ola | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| hwnd | 长整数型 | 目标窗口的句柄。 |
| x1 | 整数型指针 | 返回客户区左上角的X坐标,总是0。 |
| y1 | 整数型指针 | 返回客户区左上角的Y坐标,总是0。 |
| x2 | 整数型指针 | 返回客户区右下角的X坐标,即客户区宽度。 |
| y2 | 整数型指针 | 返回客户区右下角的Y坐标,即客户区高度。 |
示例
int x1, y1, x2, y2;
int ret = GetClientRect(instance, hwnd, &x1, &y1, &x2, &y2);
if (ret == 1) {
printf("客户区大小: %d x %d\n", x2 - x1, y2 - y1);
}
返回值
1 成功,0 失败。
