Sign in to follow this  

Child Windows - resizing problem

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have created a child window ( edit box ) , after messin round with some code I got it working , but now it wont resize at all , I've put "MoveWindow" in "WM_SIZE" I assume I'm using the right function , but it seems to be doing nothing
        case WM_SIZE:
             //resize status bar if the window is resized       
             SendMessage(g_hStatusBar, WM_SIZE, 0, 0);

         GetClientRect(g_hStatusBar, &rStatus);
         GetClientRect(hwnd, &rClientArea);
                 
         ClientWidth = rClientArea.right;
         ClientHeight = rClientArea.bottom-rStatus.bottom;
         MoveWindow(hChild, 0, 0, ClientWidth,  ClientHeight, TRUE);

I have previously declared RECT's for the main windows client area and the status bar , but I cant seem to get the edit box to resize , if I maximize the parent window the edit box stays the same , does anybody know what I mightt be causing this? here's the code I used to create the edit box
         HWND hChild;
         RECT rClientArea;
         RECT rStatus;
         
         GetClientRect(hStatusBar, &rStatus);
         GetClientRect(hwnd, &rClientArea);
         
         int ClientHeight, ClientWidth;
         ClientWidth = rClientArea.right;
         ClientHeight = rClientArea.bottom-rStatus.bottom;
         

         //create edit box         
         hChild = CreateWindowEx(
                  WS_EX_CLIENTEDGE,                   /* Extended possibilites for variation */
                  "EDIT",         /* Classname */
                  NULL,       /* Title Text */
                  WS_CHILD|WS_OVERLAPPED|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|
                  ES_MULTILINE|ES_WANTRETURN,  /* default window */
                  CW_USEDEFAULT,       /* Windows decides the position */
                  CW_USEDEFAULT,       /* Windows decides the position */
                  ClientWidth,       
                  ClientHeight,      
                  hwnd,                // the window is a child window fo the main window           
                  NULL,                /* No menu */
                  g_hInstance,       /* Program Instance handler */
                  NULL                 /* No Window Creation data */
                  ); 

Share this post


Link to post
Share on other sites

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this