The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: msmith on May 10, 2006, 05:24:50 AM

Title: Restore or Maximize Message
Post by: msmith on May 10, 2006, 05:24:50 AM
What is the best message to monitor to determine if a window has just been minimized, maximized, or restored?

I'm looking for something that works like WM_MOVE when the window is moved or WM_SIZE when the window is sized.
Title: Re: Restore or Maximize Message
Post by: Siekmanski on May 10, 2006, 07:05:11 AM
Hi msmith

Try this:

Quote
   .elseif wMsg == WM_SIZE   ; check if window size has changed
       .if wParam == SIZE_MINIMIZED
           mov      bProg_active,FALSE
           mov      bMinimized,TRUE
           mov      bMaximized,FALSE
       .elseif wParam == SIZE_MAXIMIZED
           invoke   Window_changed,hwnd ;restore window_rc
           mov      bMinimized,FALSE
           mov      bMaximized,TRUE
       .elseif wParam == SIZE_RESTORED
           .if (bMaximized)
               invoke   Window_changed,hwnd
               mov      bMaximized,FALSE
           .elseif (bMinimized)
               mov      bProg_activ,TRUE
               mov      bMinimized,FALSE
           .endif
       .endif
       return   0

   .elseif wMsg == WM_EXITSIZEMOVE
       invoke  Window_changed,hwnd
       return   0

Greetz Siekmanski
Title: Re: Restore or Maximize Message
Post by: asmfan on May 10, 2006, 09:23:49 AM
msmith, for these purposes there is WM_SYSCOMMAND with its parameters... Look it in help.
Title: Re: Restore or Maximize Message
Post by: msmith on May 10, 2006, 09:01:00 PM
I use WM_SYSCOMMAND for other things, but had not considered that it would be good for this allso.


Thanks