简体   繁体   English

运行Windows批处理文件,vbscript / wscript或Python控制台脚本时,将图像显示为初始屏幕

[英]Display an image as a splash screen when running Windows batch file, vbscript/wscript or Python console script

Any ideas how I can display an image file (bmp or png) centered on the screen as an application splash screen when running a Windows console script based on a batch file, vbscript/wscript or Python console script? 在运行基于批处理文件,vbscript / wscript或Python控制台脚本的Windows控制台脚本时,如何将屏幕中心位置的图像文件(bmp或png)显示为应用程序启动屏幕的任何想法?

I'm not interested in a wxPython solution - that's too much overhead just to implement a cosmetic feature like a splash screen. 我对wxPython解决方案不感兴趣-仅实施一个醒目的屏幕之类的装饰功能会产生太多开销。

Thank you, Malcolm 谢谢马尔科姆

A low-tech, ugly approach? 低技术,丑陋的方法? How about opening an image viewer with the bitmap and killing it after some time or when the initializations are done? 如何用位图打开图像查看器并在一段时间后或完成初始化后将其杀死? ;-) ;-)

You certainly have no native way of doing this in a batch file. 您当然没有在批处理文件中执行此操作的本地方法。 From VBScript you could use an HTA . 在VBScript中,您可以使用HTA PowerShell has no problems of doing this with Windows Forms but wasn't on your list, though. PowerShell在Windows窗体上执行此操作没有问题,但是不在您的列表中。

You can surely cook it up using the Win32 API and the win32api Python module. 您可以肯定使用Win32 API和win32api Python模块来制作它。

How about this recipe ? 这个食谱怎么样? Alternatively, this article has some C code that can be converted for invocation from Python with win32api . 或者, 本文提供了一些C代码,可以使用win32api从Python转换这些代码以进行调用。

Try TK, it is included with python. 尝试TK,它包含在python中。 Also, PyGtk is lighter than wxPython, but I ended up bitting the bullet and using wxPython for the same purpose recently, it is heavy, but it didn't have any affect on the script performance. 另外,PyGtk比wxPython轻,但是我最后还是硬着头皮,最近为了相同的目的使用wxPython,它很沉重,但是对脚本性能没有任何影响。

I'll add a late reply to the mix. 我会在混音中添加较晚的回复。 I think this is an interesting option worth looking at: 我认为这是一个值得关注的有趣选择:

http://www.quicksplash.net http://www.quicksplash.net

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过批处理文件运行时,将python脚本的输出打印到Windows控制台 - Printing output of python script to Windows console, when running via batch file 通过批处理文件运行时,如何将 python 脚本的 output 打印到 Windows 控制台? - How to print output of python script to Windows console, when running via batch file? 在Python脚本中运行批处理文件时出现Windows错误2 - Windows Error 2 when running batch file in Python script Python 放入批处理脚本时文件未运行 - Python File is not running when put in a batch script 在 python shell 从 Z0F4137ED1502B5045D6083AA258B 文件5C42Z 中运行 python 脚本 - Running python script in python shell from a windows batch file Windows 任务调度程序未运行 python 脚本/批处理文件 - Windows task scheduler not running python script/batch file 使用 ExecuteStreamCommand NIFI 通过 windows 批处理文件运行 python 脚本 - Running a python script through a windows batch file using ExecuteStreamCommand NIFI 从 windows 批处理文件运行 python 脚本 - 文件名冲突 - Running python script from windows batch file - filename conflicts 使用python脚本运行批处理文件 - Running batch file with python script 使用触摸屏启动时运行 Python 脚本时显示名称错误 - Bad Display Name when running Python script on boot with Touch Screen
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM