home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!mcsun!ieunet!tcdcs!vax1.tcd.ie!cnolan
- From: cnolan@vax1.tcd.ie
- Subject: How to test for menu bar double up when resizing window?
- Message-ID: <1992Aug15.185359.1@vax1.tcd.ie>
- Lines: 45
- Sender: usenet@cs.tcd.ie (NN required at ashe.cs.tcd.ie)
- Nntp-Posting-Host: vax1.tcd.ie
- Organization: Trinity College Dublin
- Date: Sat, 15 Aug 1992 18:53:59 GMT
- Lines: 45
-
- I use the following code to resize a window to that of a bitmap I'm
- displaying. This assumes that the menu bar is not doubled up which it will
- be for small images. I have tried various methods to test if the bar is
- going to be doubled, some don't work, others are just tacky; images
- flashing for a while.
- What is the best/proper way to check if the menu bar is going to be
- doubled? When is the window actually resized? At the next paint or
- immediately after the SetWindowPos command?
-
-
- BTW I'm doing this from home and don't have the SDK sample code to peruse.
-
- Conor Nolan
-
- #############################################################################
-
- Code fragment ...
-
- & w.x=(int)dwImageWidth+ (GetSystemMetrics(SM_CXFRAME)*2);
- &
- & // Set the width and see if the client rect is correct.
- & // If not it's because (I hope) the menu bar is doubled
- & w.y=(int)dwImageHeight+(GetSystemMetrics(SM_CYFRAME)*2)+
- & GetSystemMetrics(SM_CYCAPTION)
- & GetSystemMetrics(SM_CYMENU);
- &
- &
- & SetWindowPos(hWnd, NULL,0,0,w.x, w.y, SWP_NOMOVE);
- &
-
- #############################################################################
-
-
- --
- ===============================================================================
-
-
- Conor Nolan Phone: 772941 (X1741)
- Microelectronics Dept. Fax: 772442
- Trinity College
- Dublin 2 cnolan@mee.tcd.ie
- IRELAND
-
-
- ===============================================================================
-