Solved

CFrameWnd that overlaps the Start Menu when maximized !

Posted on 1998-11-20
4
365 Views
Last Modified: 2013-11-20
Hi !

I created a CFrameWnd usign this code :

CreateEx(0, wClass, "test", WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_SYSMENU|WS_THICKFRAME|WS_CLIPCHILDREN|WS_VISIBLE|WS_POPUP, 20, 20, 520, 560, NULL, NULL, NULL);

I didn't specify WS_CAPTION cause I don't want my window to have a caption.

Everything was fine until I try to maximize the window usign :

ShowWindow(SW_MAXIMIZE);

The result is weird : the window takes up all the screen, overlapping the Start Menu !!!  Is there a way I can go around that strange behavior without adding a caption to my window ?

Thanx
0
Comment
Question by:yletour
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Expert Comment

by:plaroche
ID: 1325056
Is WS_POPUP appropriate? Have you tried removing it?
0
 

Author Comment

by:yletour
ID: 1325057
When I remove the WS_POPUP style, my window has a caption.  But thanks for the help anyways.  I finally could find what the problem was.  I had to make a little tweak in the OnGetMinMaxInfo callback :

void CMyFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
{
      CFrameWnd::OnGetMinMaxInfo(lpMMI);

      CRect r;
      SystemParametersInfo(SPI_GETWORKAREA, 0, &r, SPIF_UPDATEINIFILE);

      lpMMI->ptMaxSize.x = r.Width();
      lpMMI->ptMaxSize.y = r.Height();
      lpMMI->ptMaxPosition.x = r.left;
      lpMMI->ptMaxPosition.y = r.top;
      
}

This does exactly what I needed !  
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1325058
You need to handle the WM_GETMINMAXINFO message. That'll give you the opportunity to specify exactly the size you want your window to have when it's maximized.  You can measure the screen your application is on by using the GetSystemMetrics() APIs.

See the FULLY.ZIP sample at http://www.nwlink.com/~mikeblas/samples/ for a program that does both of those things.

B ekiM
0
 

Author Comment

by:yletour
ID: 1325059
Thanx, this did what I needed.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
repeatSeparator  java  challenge 13 58
string initialization in java 11 117
countEvens challenge 2 113
Windows shortcut location resolution on double click open 4 53
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question