让批处理文件最小化DOS窗口? [英] Letting a Batch file Minimize a DOS window?

查看:440
本文介绍了让批处理文件最小化DOS窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有点喜欢MS-DOS,但是我开始问自己:如何最小化DOS窗口? 任何一种都可以,可以最小化,缩小到一个很小的蓝色方块.

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.

我似乎无法找到一种方法可以在Windows XP计算机上运行,​​XP中确实排除了某些东西吗?!

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

推荐答案

您可以做的一件事是创建一个Windows程序,该程序将找到正在运行的cmd窗口的标题,并在该程序中将其最小化.在Win32中,您可以使用 FindWindow 命令来获取窗口句柄,然后 CloseWindow 可以将其最小化.像这样的完全未经测试的程序:

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;
} 

在cmd窗口中,您可以将标题设置为您定义的某个字符串(以避免歧义),然后将该名称传递给程序到您的程序中:

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

这篇关于让批处理文件最小化DOS窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆