Search code examples
windowsminimizeshrink

Letting a Batch file Minimize a DOS window?


So i'm kinda into MS-DOS and such again, but i came to ask myself, How can i minimize a DOS window? Any kind would be ok, minimalize, shrink to a tiny blue block.

I just can't seem to find a way to let it work on my Windows XP computer, is realy evrything excluded in XP?!


Solution

  • One thing you could do is create a windows program that will find the title of the cmd window you are running in and in that program minimize it. In Win32 you would use the FindWindow command to get a window handle, then CloseWindow to minimize it. Something like this totally untested program:

    int main(int argc, char** argv)
    {
        HWND wnd = FindWindow(      
            NULL,
            argv[1]
            );
        CloseWindow(wnd);
        return 0;
    } 
    

    Within the cmd window you could set the title to some string that you define (to avoid ambiguities) and then pass that name to the program to your program:

    C:\>title TitleOfWindowToMiniMize
    
    C:\>minimizeWindow TitleOfWindowToMiniMize