home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1342 < prev    next >
Encoding:
Text File  |  1992-08-15  |  2.0 KB  |  58 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!mcsun!ieunet!tcdcs!vax1.tcd.ie!cnolan
  3. From: cnolan@vax1.tcd.ie
  4. Subject: How to test for menu bar double up when resizing window?
  5. Message-ID: <1992Aug15.185359.1@vax1.tcd.ie>
  6. Lines: 45
  7. Sender: usenet@cs.tcd.ie (NN required at ashe.cs.tcd.ie)
  8. Nntp-Posting-Host: vax1.tcd.ie
  9. Organization: Trinity College Dublin
  10. Date: Sat, 15 Aug 1992 18:53:59 GMT
  11. Lines: 45
  12.  
  13. I use the following code to resize a window to that of a bitmap I'm 
  14. displaying.  This assumes that the menu bar is not doubled up which it will 
  15. be for small images.  I have tried various methods to test if the bar is 
  16. going to be doubled, some don't work, others are just tacky; images 
  17. flashing for a while.  
  18. What is the best/proper way to check if the menu bar is going to be 
  19. doubled?  When is the window actually resized?  At the next paint or 
  20. immediately after the SetWindowPos command?
  21.  
  22.  
  23. BTW I'm doing this from home and don't have the SDK sample code to peruse.
  24.  
  25. Conor Nolan
  26.  
  27. #############################################################################
  28.  
  29. Code fragment ...
  30.  
  31. &     w.x=(int)dwImageWidth+ (GetSystemMetrics(SM_CXFRAME)*2);
  32. &
  33. &     // Set the width and see if the client rect is correct.
  34. &     // If not it's because (I hope) the menu bar is doubled
  35. &     w.y=(int)dwImageHeight+(GetSystemMetrics(SM_CYFRAME)*2)+
  36. &                                             GetSystemMetrics(SM_CYCAPTION)
  37. &                                             GetSystemMetrics(SM_CYMENU);
  38. &
  39. &
  40. &     SetWindowPos(hWnd, NULL,0,0,w.x, w.y, SWP_NOMOVE);
  41. &
  42.  
  43. #############################################################################
  44.  
  45.  
  46. -- 
  47. ===============================================================================
  48.  
  49.              
  50.                 Conor Nolan            Phone:    772941 (X1741)
  51.                Microelectronics Dept.        Fax:    772442
  52.                 Trinity College            
  53.               Dublin 2            cnolan@mee.tcd.ie
  54.                IRELAND
  55.             
  56.  
  57. ===============================================================================
  58.