Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 3rd, 2006, 4:42 PM   #1
Kennedy
Newbie
 
Join Date: Aug 2006
Location: Alabama
Posts: 26
Rep Power: 0 Kennedy is on a distinguished road
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!
Kennedy is offline   Reply With Quote
Old Aug 4th, 2006, 1:06 AM   #2
Cache
Hobbyist
 
Join Date: Sep 2005
Posts: 273
Rep Power: 4 Cache is on a distinguished road
Quote:
Originally Posted by Kennedy
When I answer the call WM_SIZING, I am mainly keeping the user from "growing" the window smaller than 800x600
I would use the WM_GETMINMAXINFO message for that.
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;
           
           //...
   }
   //...
}
I don't know about your actual problem, thought.
Cache is offline   Reply With Quote
Old Aug 4th, 2006, 3:09 AM   #3
Kennedy
Newbie
 
Join Date: Aug 2006
Location: Alabama
Posts: 26
Rep Power: 0 Kennedy is on a distinguished road
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?
Kennedy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:26 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC