【C/C++】FixedConsole

#define _WIN32_WINNT 0x0500
#include <Windows.h>
#include <stdio.h>

int main()
{
    SetWindowLongW(GetConsoleWindow(), GWL_STYLE, GetWindowLongW(GetConsoleWindow(), GWL_STYLE) & ~WS_MAXIMIZEBOX);
    //SetWindowLongW(GetConsoleWindow(), GWL_STYLE, GetWindowLongW(GetConsoleWindow(), GWL_STYLE) & ~WS_MINIMIZEBOX);
    SetWindowLongW(GetConsoleWindow(), GWL_STYLE, GetWindowLongW(GetConsoleWindow(), GWL_STYLE) & ~WS_THICKFRAME | WS_BORDER);
    DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE, MF_BYCOMMAND);
    DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_MAXIMIZE, MF_BYCOMMAND);
    //DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_MINIMIZE, MF_BYCOMMAND);
    DeleteMenu(GetSystemMenu(GetConsoleWindow(), FALSE), SC_MOVE, MF_BYCOMMAND);
    DrawMenuBar(GetConsoleWindow());
}
posted @ 2020-04-29 11:46  XKIND  阅读(31)  评论(0编辑  收藏  举报