win32 - CreateWindowEX with a child window resizeable only at the right border (c++)

Discussion in 'OT Technology' started by Shibboleth, Mar 16, 2005.

  1. Shibboleth

    Shibboleth teh mad Plato skillz

    Joined:
    Sep 29, 2004
    Messages:
    1,769
    Likes Received:
    0
    Does anyone know how to achieve this? currentley I am using:

    Code:
    hcTreeWnd = CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
    WS_SIZEBOX|WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT,
    CW_USEDEFAULT,0,200,rcClient.bottom,hWnd,NULL,hInstance,NULL); 
    
    It all works well and fine, but the user can resize it anyway they please. I primarily want it anchored to the left, top, and bottom of the parent window and resizable towards the right. Any help would be much appreciated.
     
  2. Shibboleth

    Shibboleth teh mad Plato skillz

    Joined:
    Sep 29, 2004
    Messages:
    1,769
    Likes Received:
    0
    bump, still need help please
     
  3. StevesVR4

    StevesVR4 Get Arrested

    Joined:
    Jul 1, 2003
    Messages:
    7,328
    Likes Received:
    0
    I haven't created windows this way in a while, but you will probably need to change the min/max size of the window after it is created. Set the min and max for the vertical size to be the same and provide a range for the horizontal size so the user can change the size from the left or right. It doesn't matter if the user resizes the window from the left or right as compared to just the right side since the window should always start from the left border.
     
  4. skinjob

    skinjob Active Member

    Joined:
    Jan 6, 2001
    Messages:
    2,337
    Likes Received:
    0
    Location:
    Aztlán
    In your window's message handler, intercept the WM_SIZING message. The message parameters tell you which edge is being used and the window size. If the user is using anything other than the right edge, don't let the window size change.
     
  5. Shibboleth

    Shibboleth teh mad Plato skillz

    Joined:
    Sep 29, 2004
    Messages:
    1,769
    Likes Received:
    0
    hmm, that's just what I might do. Thank you. It's either that or write a slider bar.
     

Share This Page