1

Is there a signal or event in the Windows Desktop API that can tell me if my application is in a minimized state? I looked through msdn documentation and have only found minimize events that call as the application is minimizing, not when the application is already done the minimize and in a final minimized state.

I need to set another operation off ( a screen capture) when I know the window that I set is minimized and out of the way of the screen capture. I use the WM_SIZE message to check the window is minimized, then start the screen capture. My problem is that I can still see the application window closing when the screen capture is taken (i.e. the minimization animation done by most application windows), even though I got a SIZE_MINIMIZED message through a ProcessWindowMessage callback. I need something to tell me that the application is fully minimized, and not in the way of the screen capture I am taking of the entire desktop.

Thanks!

sharen
  • 11
  • 3

3 Answers3

2

You probably want IsIconic(); if your window is minimized that API will return non-zero.

HerrJoebob
  • 2,264
  • 16
  • 25
1

I believe you are looking for the WM_SIZE message. It will be sent after the window's size has changed. If you window was minimised the wParam variable should be equal to SIZE_MINIMIZED

shf301
  • 31,086
  • 2
  • 52
  • 86
0

You can try the solution mentioned here: How could I detect when my application is minimized?

~snip:

switch (message)
{
case WM_SYSCOMMAND:
    if ((wParam & 0xFFF0) == SC_MINIMIZE)
    {
        // shrink the application to the notification area
        // ...

        return 0;
    }
    break;
}

Or try the GetWindowPlacement function: https://msdn.microsoft.com/en-us/library/windows/desktop/ms633518(v=vs.85).aspx

~snip

Retrieves the show state and the restored, minimized, and maximized positions of the specified window.

Community
  • 1
  • 1
kvr
  • 573
  • 2
  • 8