News:

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

Sizing of controls

Started by joemc, March 11, 2010, 05:51:53 AM

Previous topic - Next topic

joemc

I am currently using WM_SIZE to change the size of all of my controls to fit the window.

The window looks great when resizing (as it should).

The problem i have is my tab control is a multi line one, and when i add a tab that needs another row, it does not resize the contents inside.

Basically i need to send or post a WM_SIZE and i thought i was clever when i tried:

invoke SetWindowPos,hWindow,0,0,0,0,0,SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER

but i wasn't because it did not work. I can only see two ways to fix the issue, but i really want a third that i don't know.  Currently my WM_SIZE code uses the lparam for its width and height, i could instead get the rect of the window using GetWindowRect or GetClientRect.  Or i could do the same on the other end, and pack a lparam together and send a WM_SIZE.    There should be a way to tell Windows to do this?  no?

edit:
for now i have just made an onSize procedure that takes two dwords and my window procedure calls it,  and i can call it directly when a new tab is created.

  Case WM_SIZE
    movzx ecx,word ptr lParam   ; WIDTH
    movzx edx,word ptr lParam+2 ; HEIGHT
    invoke onSize,ecx,edx
    ret




  invoke GetClientRect,hWindow,ADDR rect
  mov edx, rect.right
  mov ecx, rect.bottom
  sub edx, rect.left
  sub ecx, rect.top
  invoke onSize,edx,ecx