News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

any secret behind Status Bar?

Started by xiahan, April 01, 2012, 04:23:19 AM

Previous topic - Next topic

xiahan

.elseif uMsg == WM_SIZE

        invoke SendMessage,hToolBar,TB_AUTOSIZE,0,0

        m2m caW, lParam[0]  ; client area width
        m2m caH, lParam[2]  ; client area height

        invoke GetWindowRect,hStatus,ADDR Rct
        mov eax, Rct.bottom
        sub eax, Rct.top
        sub caH, eax
        sub caH,120

        invoke MoveWindow,hStatus,0,caH,caW,39,TRUE
no matter how i change the paramter to the call of MoveWindow, when resize ,the status bar is still at the client area bottom , holds the width of caW.

hutch--

xiahan,

A status bar is designed to stay at the bottom of the window client area. If you want a window to do otherwise, create your own with a new WNDCLASSEX structure and give it whatever characteristics you like. It will work correctly with MoveWindow() or SetWindowPos().
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

you can locate the status bar anywhere you like if you use CreateWindowEx to create it (i am pretty sure, at least)
use the predefined system class...
szStatusBarClass db 'msctls_statusbar32',0

but - you have to handle WM_SIZE, too   :P

use WS_CHILD or WS_VISIBLE style

xiahan

Thanks hutch-- and dedndave  it seems every problem i met during the explore of masm can be solved by experienced guys(like you)  in this forum immediately and patiently, it realy makes me feel good! :lol

dedndave

lol
well - i learned that the hard way
it wasn't by design   :P