我正在尝试获取外部窗口的大小:
POINT point;
point.x = 100;
point.y = 100;
HWND hwnd = WindowFromPoint(point);
LPRECT pRect = {0};
bool ret1 = IsWindow(hwnd);
bool ret = GetWindowRect(hwnd, pRect);
IsWindow 的返回值为 true,但 GetWindowRect 失败并出现以下错误:
1400:无效的窗口句柄
有什么问题?