![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2006
Location: Alabama
Posts: 26
Rep Power: 0
![]() |
Where did that child get off to now?
I have a rather complex program that has 5 subwindows. Each done differently would be very easy to do, however, since my boss has requested special shading on EACH LINE of text, I have had to do things the long way (IE, I'm not using any of the default windows).
The problem: I answer the call for WM_PAINT in the child wndproc. I answer the call for WM_SIZING and WM_SIZE (not with the same code) in the parent wndproc. When I answer the call WM_SIZING, I am mainly keeping the user from "growing" the window smaller than 800x600 as this is the smallest that my boss wants me to go. The child windows repaint fine. When, however, the user clicks on MAXIMZE, the screen doesn't paint exactly correctly. In child 1, there is supposed to be a VS_SCROLL, however, the window size is calculated incorrectly (at 1280x1024) and is not shown. The user can click a new selection in child 0 and child 1 repaints correctly. When the user then clicks the "Restore Down" button, child windows 0, 1 display with the incorrect number of lines (as if the calculation was taken before the window actually resized) and child 4 disappears all the way. Anyone got any ideas about this? I'd show you code, but it is in about 8 files and is a pile of spaghetti. Let me know if you need me to post it. Thanks for any help you can provide! |
|
|
|
|
|
#2 | |
|
Hobbyist
Join Date: Sep 2005
Posts: 273
Rep Power: 4
![]() |
Quote:
LRESULT CALLBACK WinProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
//...
switch(uMsg)
{
case WM_GETMINMAXINFO:
{
MINMAXINFO* pMinMaxInfo = (MINMAXINFO*)lParam;
pMinMaxInfo->ptMinTrackSize.x = 800;
pMinMaxInfo->ptMinTrackSize.y = 600;
}
break;
//...
}
//...
} |
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Aug 2006
Location: Alabama
Posts: 26
Rep Power: 0
![]() |
I didn't learn that one until today (well, yesterday). The way I'm doing that part of it works, but I'll consider changing it. I had also thought to actually use the GetWindowPlacement (which is how I learned about the WM_GETMINMAXINFO message) to get the "real" coordinates of the window. Micro$oft says that one shouldn't use that, however, because one could cause "the window appearing in the wrong location" (according to http://msdn.microsoft.com/library/de...placement.asp).
So. . . I'm still at a loss. -- Another really weird thing about this whole issue is that when I put in a MessageBox inside the location where I actually set the coordinates of each window, I get all correct responces. . . as if the MessageBox affects the way the window refreshes the size of the client area. Anybody have any ideas on that? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MySQL connection bottleneck? | Jimbo | Other Web Development Languages | 8 | Jun 28th, 2006 9:27 PM |
| allow one instance of child form to be loaded | davids_maguire | C# | 8 | Mar 21st, 2006 11:33 AM |
| spawning child processes in Java | thenewkid | Java | 2 | Feb 28th, 2006 9:50 PM |
| C# 2005 - ComboBoxes with Parent / Child relation in DataGridView | jcrcarmo | C# | 0 | Feb 22nd, 2006 12:25 AM |
| please help. hierarchical data structures. | vitroblue | C++ | 5 | Jun 26th, 2005 3:13 PM |