转载 1.简单分析:调用windowsAPI函数;让窗口固定;
#include <Windows.h>
int main() {
printf("hello\n");
HWND hWnd
= GetConsoleWindow();
RECT rc
;
GetWindowRect(hWnd
, &rc
);
SetWindowLongPtr(hWnd
,
GWL_STYLE
, GetWindowLong(hWnd
, GWL_STYLE
) & ~WS_THICKFRAME
& ~WS_MAXIMIZEBOX
& ~WS_MINIMIZEBOX
);
SetWindowPos(hWnd
,
NULL,
rc
.left
,
rc
.top
,
rc
.right
- rc
.left
, rc
.bottom
- rc
.top
,
NULL);
return 0;
}
转载请注明原文地址: https://mac.8miu.com/read-515122.html