News:

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

Status Bar Help

Started by RuiLoureiro, August 11, 2008, 03:41:09 PM

Previous topic - Next topic

RuiLoureiro

Hi
                  I want to create 2 status bars: one above the other at the bottom

The code:


;.........................................
.data
_hWndStat1      dd 0
_hWndStat2      dd 0
_StatClass      db  'msctls_statusbar32',0

_StaBarError1   dd 0
_StaBarError2   dd 0
_sbParts        dd 4 dup (0)
;...........................................
.code
...
_WM_CREATE::   
;---------------------------- [Create the status bar window 1] ----------
                invoke     CreateWindowEx, 0, addr _StatClass, 0,
                       WS_CHILD or WS_BORDER or WS_VISIBLE or CCS_BOTTOM,
                       0, 0, 0, 0, _hpWnd, 100, _hInstance, 0
                mov        _hWndStat1, eax
                cmp        eax, 0
                jne        @F
                ; 
                call    GetLastError
                mov        _StaBarError1, eax
;---------------------------- [Create the status bar window 2 ] ----------
@@:         invoke     CreateWindowEx, 0, addr _StatClass, 0,
                           WS_CHILD or WS_BORDER or WS_VISIBLE or CCS_TOP,
                            0, 0, 0, 0, _hpWnd, 200, _hInstance, 0
                mov        _hWndStat2, eax
                cmp        eax, 0
                jne        @F
                ; 
                call    GetLastError
                mov        _StaBarError2, eax

;-----------------------------------------------------------------
        To resize and move the second Status Bar
;-----------------------------------------------------------------       

...
_WM_SIZE::  mov     [_sbParts+0], 240
          mov     [_sbParts+4], 310       
          mov     [_sbParts+8], 580
          mov     [_sbParts+12], -1   ; The last part extends to the end
     
     invoke     SendMessage, _hWndStat1, SB_SETPARTS, 4, addr _sbParts
;________________________________________
;    It doenst WORK. It stays at the TOP
;________________________________________
    invoke     MoveWindow, _hWndStat2, 0, 480, 0, 8, TRUE
    cmp        eax, TRUE
      je         @F
      ;
    call      GetLastError
    mov        _StaBarError2, eax
@@:           


        invoke     MoveWindow, _hWndStat2, 0, 480, 0, 8, TRUE
        and RETURNS with EAX = TRUE

        doenst WORK.

       The second Status Bar stays at the TOP where it was created
        and _StaBarError2 = 0 and means: It was moved.

        Whats wrong here ? How to solve the problem ?
        Can anyone help me

Rui

wjr

For the second Status Bar, instead of CCS_TOP, try CCS_NOPARENTALIGN along with a non-zero Width for MoveWindow.

RuiLoureiro

Quote from: wjr on August 11, 2008, 08:48:11 PM
For the second Status Bar, CCS_NOPARENTALIGN along with a non-zero Width .
Hi wjr,
           Thank you . It seems to work, but today it is late here.
            I will come back tomorrow
Rui