How to put window into minimized?

Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <Windows.h>

int WinMain(
    HINSTANCE hInst,
    HINSTANCE hPrev,
    LPSTR cmdLine,
    int cmdShow)
{
    // either create your window here, or get an HWND somehow
    HWND hwnd = GetConsoleWindow();
    if (hwnd) {
        // found the window, now we minimize it
        ShowWindow(hwnd, SW_MINIMIZE);

        // if your handle is to someone else's window, you'll need to use
        // ShowWindow(hwnd, SW_FORCEMINIMIZE);
        // to hide it.
    }

    return 0;
}

That's as much as I can give you with the information you've given.
Topic archived. No new replies allowed.