The following program displays a window with a status bar. Both the
window and the status bar display size grips (the /// in the lower
right corners), but I think it is incorrect for the status bar to
display one since I did not specify SBARS_SIZEGRIP in the status bar's
CreateWindow.
I am looking for an answer that does either of the following:
1) Uses official Microsoft documentation or publications to explain
why the observed behavior is correct & how to get the desired behavior
without resorting to a workaround (I already know that clearing
WS_THICKFRAME when creating the main window & setting it later is a
workaround), or
2) Uses official Microsoft documentation or publications to show that
this is a known bug.
#include <windows.h>
#include <tchar.h>
#include <commctrl.h>
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
InitCommonControls();
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = 0;
wcex.lpfnWndProc = DefWindowProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance,
(LPCTSTR)IDI_APPLICATION);
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)
GetStockObject(WHITE_BRUSH);
wcex.lpszMenuName = 0;
wcex.lpszClassName = "MyWindowClass";
wcex.hIconSm = LoadIcon(wcex.hInstance,
(LPCTSTR)IDI_APPLICATION);
RegisterClassEx(&wcex);
HWND hWnd = CreateWindow("MyWindowClass","MyWindow",
WS_VISIBLE | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN |
WS_HSCROLL | WS_VSCROLL,
0, 0, 300, 300, NULL, NULL, hInstance, NULL);
HWND hStatusBar = CreateWindow(STATUSCLASSNAME, "StatusBar",
WS_VISIBLE | WS_CHILD, 0, 0, 0, 0, hWnd, NULL,
hInstance, NULL);
MSG msg;
while(GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
} |