Q: C++ WinAPI window size less than 17 I have a university assignment for my programming class to set up a C++/Win32API script which would use tiny windows to show an analog clock.
All fine and dandy but I cannot figure out how to resize a window to less than ~17 px.
I tried to handle the 
case WM_GETMINMAXINFO:
{
    MINMAXINFO* mmi = (MINMAXINFO*)lParam;
    mmi->ptMinTrackSize.x = 1; // doesn't do anything below 18-20
    mmi->ptMinTrackSize.y = 1; // same as above
    return 0;
}

yet the window doesn't want to resize below around 17 pixels in width or height.
I use the following code to create the windows
   hWnd = CreateWindowEx(
        WS_EX_TOOLWINDOW,
        szWindowClass,
        _T( "tool" ),
        WS_EX_TOOLWINDOW,
        300 + ( 20 * i ), // x
        150, // y
        1, // width
        1, // height
        NULL, 
        NULL, 
        hInstance, 
        NULL
    );
   SetWindowLong(hWnd, GWL_STYLE, 0); // remove borders

the orange boxes are 18 little windows that I tried to create:


A: The correct combination of window style flags to achieve this, is the following:
WS_POPUP | WS_BORDER | WS_VISIBLE
The call to SetWindowLong is not needed. If you really want no border, you can omit the WS_BORDER flag. What WS_POPUP does, is to suppress the non-client area of the window entirely. Therefore, no minimums apply and you can make the window as small as 1 x 1 px.
hWnd = CreateWindow(
    szWindowClass,
    0,
    WS_POPUP | WS_BORDER | WS_VISIBLE,
    300 + (20 * i),
    150,
    1,
    1,
    nullptr,
    nullptr,
    hInstance,
    this
);

See also:
How can I remove a window's non-client area completely?
https://stackoverflow.com/a/43819334/1132334
Tested on a Windows 10 Version 2004.
