News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Restore or Maximize Message

Started by msmith, May 10, 2006, 05:24:50 AM

Previous topic - Next topic

msmith

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.

Siekmanski

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

asmfan

msmith, for these purposes there is WM_SYSCOMMAND with its parameters... Look it in help.
Russia is a weird place

msmith

I use WM_SYSCOMMAND for other things, but had not considered that it would be good for this allso.


Thanks