Minimizing all open windows in C#

Posted by Charlie Somerville on Stack Overflow See other posts from Stack Overflow or by Charlie Somerville
Published on 2009-04-24T09:00:29Z Indexed on 2010/03/20 20:51 UTC
Read the original article Hit count: 284

Filed under:
|
|
|

I saw this C++ code on a forum which minimizes all open windows

#define MIN_ALL        419
#define MIN_ALL_UNDO   416

int main(int argc, char* argv[])
{
    HWND lHwnd = FindWindow("Shell_TrayWnd",NULL);
    SendMessage(lHwnd,WM_COMMAND,MIN_ALL,0);
    Sleep(2000);
    SendMessage(lHwnd,WM_COMMAND,MIN_ALL_UNDO,0);
    return 0;
}

How can I access the FindWindow and SendMessage API function and the HWND type in C#.net?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET