-
June 16th, 2009, 04:37 AM
#1
Maximize of Mainframe doesn't occupy whole screen
Good day!
I am trying to fix an issue in a program made by someone else, so i am not familiar with all of the code.
Anyway, i hope it seems simple enough for someone experienced.
The program is using MFC and is MDI.
When the program starts it is in the maximized position by default.
Sometimes the maximized position occupies correctly the whole screen (except from the taskbar)
but sometimes it occupies less than the whole screen (about half an inch from the top is unoccupied)
Note that if the program starts correctly occupying the screen it preserves this correct state through runtime.
By using the getClientRect() of the main window i find that indeed the clientRect is less than it should when the whole screen isn't occupied.
Anyone has encountered something similar? Any guesses?
-
June 16th, 2009, 04:50 AM
#2
Re: Maximize of Mainframe doesn't occupy whole screen
Did you try to klick the "maximize" button on the mainframe system menu?
Victor Nijegorodov
-
June 16th, 2009, 05:10 AM
#3
Re: Maximize of Mainframe doesn't occupy whole screen
Yes of course!
I've done a lot of resizing/minimize/maximize both with buttons and with code i.e. ShowWindow(SW_MAXIMIZE) , but if the application started initially with wrong positioning, it keeps maximizing to this "false" position.
-
June 16th, 2009, 07:14 AM
#4
Re: Maximize of Mainframe doesn't occupy whole screen
Is there code overriding the default WM_SHOW or WM_GETMINMAXINFO handlers?
-
June 16th, 2009, 08:33 AM
#5
Re: Maximize of Mainframe doesn't occupy whole screen
No, nothing like that in the whole project...
-
June 16th, 2009, 08:38 AM
#6
Re: Maximize of Mainframe doesn't occupy whole screen
Look at the OnSize implementation. It must have some logic to resize the window.
-
June 17th, 2009, 03:24 AM
#7
Re: Maximize of Mainframe doesn't occupy whole screen
The OnSize implementation indeed contains something but i think it is irrelevant.
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
}
I commented the above line of code and still the positioning was wrong...
-
June 17th, 2009, 03:31 AM
#8
Re: Maximize of Mainframe doesn't occupy whole screen
What you showed us is the default OnSize implementation, so it cannot be a reason of your trouble.
How about a WM_SYSCOMMAND message handler?
Victor Nijegorodov
-
June 17th, 2009, 06:39 AM
#9
Re: Maximize of Mainframe doesn't occupy whole screen
Nothing like that in the whole project as well...
-
June 17th, 2009, 07:59 AM
#10
Re: Maximize of Mainframe doesn't occupy whole screen
Then I would suggest to consecutively remove all "non-important" things from this project, leaving only the "carcass" until the problem goes away.
If it won't go away - post this "carcass"-project to the Forum.
Victor Nijegorodov
-
June 17th, 2009, 08:56 AM
#11
Re: Maximize of Mainframe doesn't occupy whole screen
Originally Posted by stakon
Nothing like that in the whole project as well...
There's got to be. Can you post the header file for the mainframe class.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|