I wanted to add status bar to my list view window so I just use CreateStatusWindow. No problem. Trouble starts when I click on scroll bar and status bar starts to slide up the window? Any body no how to fix this? Also if I resize window status bar stays small. best regards, czDrillard
Posted on 2001-06-02 12:47:00 by czDrillard
i suppose ur problem might be the WM_SIZE at least i used to have the same problem there, so check what u´ve done so far there
Posted on 2001-06-02 13:47:00 by Allanon
Thanks Allanon, I did like you say and process the WM_SIZE and now the status bar sizes correctly. There is still major problem with horizontal scroll bar because the status bar covers it up. Then when you click on status bar, scroll bar shows through and status bar is mostly gone. Does anybody know have this same problem and how I can fix it?
Posted on 2001-06-03 18:53:00 by czDrillard
hm sounds for me like ther´s still a prob in the WM_SIZE maybe try something like that


LOCAL rect:RECT
LOCAL sbh    :DWORD
LOCAL wWid   :DWORD
LOCAL wHgt   :DWORD

.ELSEIF uMsg==WM_SIZE   

    invoke MoveWindow,hStatus,0,0,0,0,TRUE
    invoke GetClientRect,hStatus,ADDR rect
    push rect.bottom
    pop sbh     
        
    invoke GetClientRect,hWnd,ADDR rect
    push rect.right
    pop wWid
        
    push rect.bottom
    pop wHgt
  
    mov eax,  0
    sub wHgt, eax
    mov eax,  sbh
    sub wHgt, eax

    sub wHgt, 2
    invoke MoveWindow,hwndList,0,0,wWid,wHgt,TRUE

This message was edited by Allanon, on 6/4/2001 4:38:02 AM
Posted on 2001-06-04 04:24:00 by Allanon
Thanks again Allanon, your code works good but re-sizing is not the problem. Here's what happen: I made listview with Iczelion tut 31 and added status bar so I display number of entries and total number of bytes. Cool. Now the trouble, If I make status bar using window handle its created on top of and hides the horizontal scroll bar underneath itself. If I make status bar using handle of listview window it is above scroll bar and looks good but as soon as I try to vertical scroll the bar is copied many times up the window. I tried update window, invalidate rect etc and nothing seems to make this work. I got no idea what to think from here. Any ideas or suggestions welcome. best regards, czDrillard
Posted on 2001-06-05 01:50:00 by czDrillard
send it to me might be easier for me to follow it when i see what´s happenin, maybe i see the prob
Posted on 2001-06-05 07:09:00 by Allanon
hi you must create the status bar using your main window handle(where you use your statusbar). if it hides the horizontal scrollbar(of the listview?) i agree with Allanon, i think the resizing it's not being done properly(even if you don't resize your running prog with the mice:)). you said you're using Iczelion's listview tut. on the WM_SIZE msg the listview is resized to fit the whole window, so instead of that you should get the status bar height and subtract it from the main window and then move the listview to fit that area.. well don't know more than this.. post your code on the WM_SIZE if you have more problems. ensein
Posted on 2001-06-05 10:47:00 by ensein
Hi ensein, Yeah, I think you exactly right. I must subtract status bar height from window. Could you suggest a way to do this? Here is my size code: It is part Allanon's and part from Iczelion. They seem to be interchangable. .elseif uMsg==WM_SIZE invoke GetClientRect,hWndStatus,ADDR rect push rect.bottom pop sbh invoke GetClientRect,hWnd,ADDR rect push rect.right pop wWid push rect.bottom pop wHgt mov eax, 0 sub wHgt, eax mov eax, sbh sub wHgt, eax sub wHgt, 2 invoke MoveWindow,hWndStatus,0,0,wWid,wHgt,TRUE mov eax,lParam mov edx,eax and eax,0ffffh shr edx,16 invoke MoveWindow,hList,0,0,eax,edx,TRUE best regards, czDrillard
Posted on 2001-06-05 23:15:00 by czDrillard
ok, here's the code with comments.. much easier to understand. i didn't test this but i think it should work.

LOCAL rect:RECT
LOCAL sbh    :DWORD   ;maybe these are not necessary but i'll use it anyway
LOCAL wWid   :DWORD   ;
LOCAL wHgt   :DWORD   ;

...

.ELSEIF uMsg==WM_SIZE

 invoke GetClientRect,hStatus,ADDR rect     ;get the coords of status bar
 mov eax,rect.bottom                        ;we only need the height
 mov sbh,eax                                ;so save it

 ;when receiving the VM_SIZE msg 
 ;lparam hi word contains the height of the main window client area
 ;lparam lo word contains the width of the main window client area

 mov edx,lParam       ;get the main client area height and width values
 mov eax,eax          ;make a copy to eax
 shr eax,16           ;now eax has the high word of lparam (client area height)
 and edx,0ffffh       ;now edx has only the lo word of lparam (client area width)
  
 sub eax,sbh          ;client area without the status bar height
 mov wHgt,eax         ;saving this values for further reference
 mov wWid,edx         ;
 
 ;now lets move our windows

 ;moving status bar to the bottom
 invoke MoveWindow,hStatus,0,wHgt,sbh,wWid,TRUE
 ;and now moving listview
 invoke MoveWindow,hList,0,0,wHgt,wWid,TRUE

Posted on 2001-06-06 17:18:00 by ensein
Hey,hey, That code did it ensein. I just made few changes and everything working :) best regards, czDrillard
Posted on 2001-06-07 21:52:00 by czDrillard