c++ - Adding statusbar in Win32 application -
c++ - Adding statusbar in Win32 application -
i want add together statusbar win32 application. found out can utilize createstatuswindow
function. works fine until re-size window. see part of block of code:
bool initinstance(hinstance hinstance, int ncmdshow) { hwnd hwnd; hinst = hinstance; // store instance handle in our global variable hwnd = createwindow(szwindowclass, sztitle, ws_overlappedwindow, cw_usedefault, 0, cw_usedefault, 0, null, null, hinstance, null); if (!hwnd) { homecoming false; } createstatuswindow(ws_child | ws_visible, _t("welcome spywindows"), hwnd, 9000); showwindow(hwnd, ncmdshow); updatewindow(hwnd); homecoming true; }
here 2 printscreens of application main window:
what can have status bar? (i want split in more areas)
the documentation mentions status bar recompute appropriate position , size when receives wm_size message:
the window procedure automatically adjusts size of status bar whenever receives wm_size
message. typically, when size of parent window changes, parent sends wm_size
message status bar.
so, simplest way accomplish relay status bar wm_size
messages received parent (with sendmessage(), window procedure). message parameters not matter, status bar not utilize them in computations.
c++ winapi statusbar
Comments
Post a Comment