Cant get rid of the box without removing sysmenu, but you can remove the WS_MAXIMIZEBOX style so the maximise option is greyed out. Is this what you want?
Code:
#include <windows.h>
#include <tchar.h>
LRESULT CALLBACK WndProc(HWND hWnd,UINT msg, WPARAM wParam, LPARAM lParam){
switch(msg){
case WM_CLOSE:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE,LPSTR,int nShow){
TCHAR szWindowName[]= _T("Magos");
WNDCLASSEX wc= {0};
HWND hWnd;
MSG msg;
DWORD dwStyle;
wc.cbSize= sizeof(WNDCLASSEX);
wc.style= CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
wc.lpfnWndProc= WndProc;
wc.hInstance= hInst;
wc.hIcon= LoadIcon(NULL, IDI_WINLOGO);
wc.hCursor= LoadCursor(NULL,IDC_ARROW);
wc.lpszClassName= szWindowName;
wc.hbrBackground= CreateSolidBrush(RGB(255, 255, 255));
wc.hIconSm= LoadIcon(NULL, IDI_WINLOGO);
if(!RegisterClassEx(&wc))return EXIT_FAILURE;
dwStyle = WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX;
hWnd= CreateWindowEx(WS_EX_CLIENTEDGE | WS_EX_ACCEPTFILES,szWindowName,
szWindowName,dwStyle,CW_USEDEFAULT,CW_USEDEFAULT,
400,400,HWND_DESKTOP,NULL,hInst,NULL);
if(!hWnd) return EXIT_FAILURE;
ShowWindow(hWnd, nShow);
UpdateWindow(hWnd);
while(GetMessage(&msg, NULL, 0, 0) > 0){
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}