Jump to content
  • Advertisement
Sign in to follow this  
stealth

Child Windows - resizing problem

This topic is 5172 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
Advertisement
yeah its calid inside WM_SIZE , I think it might be that overlapped style , I was thinkin it might be summin like that

I'll try it

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!