相关疑难解决方法(0)

我无法掌握LPRECT结构数据,我做错了什么?

它应该没有问题:

#include <iostream>
#define _WIN32_WINNT 0x501
#include <windows.h>

using namespace std;

int main() {
  HWND consoleWindow = GetConsoleWindow();
  LPRECT lpRect;
  GetWindowRect(consoleWindow,lpRect);
  cout << lpRect.top <<endl;
}
Run Code Online (Sandbox Code Playgroud)

但相反,我得到了这个:

error: request for member 'top' in 'lpRect', which is of non-class type 'LPRECT {aka tagRECT*}'
Run Code Online (Sandbox Code Playgroud)

c++ winapi

4
推荐指数
2
解决办法
5483
查看次数

标签 统计

c++ ×1

winapi ×1