m_iWndWidth = GetSystemMetrics(SM_CXSCREEN); // Supposed to get window width, but gets COMPUTER MONITOR WIDTH!
m_iWndHeight = GetSystemMetrics(SM_CYSCREEN); // Same thing
MoveWindow(hChildWnd, 0, 0, m_iWndWidth, m_iWndHeight, FALSE); // This would be a situation with only 1 child window (for testing)
Child windows auto-resize?
I'm currently in the midst of developing a Map Editor for a 2D RPG in c++. I just finished writing the engine yesterday (or so I think), and I have a seemingly trivial problem but it's not. When I create my main window, I also create 2 child windows in the main one. The main window is 800 x 600, and the child windows fit perfectly TO THE PIXEL thanks to the GetSystemMetrics function. But when I resize the main window (i.e. maximize), the child windows obviously stay the same size. I need help with a technique to auto-resize the child windows when the main one is resized. Here's what I tried, but it didn't work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement