[英]How to run an exe file from windows command line without the title bar?
I have an external .exe
file that I need to run on my PC for a demo. 我有一个外部
.exe
文件,需要在我的PC上运行以进行演示。 I'm running the .exe
file from the command line (from CMD) and when I run the .exe
file it opens up in a winforms window with the title bar as a regular window. 我运行
.exe
(从CMD)命令行文件,当我运行.exe
文件时,它在标题栏为普通窗口的WinForms窗口打开。
I need to be able to run that .exe
file with the following restrictions: 我需要能够以下列限制运行该
.exe
文件:
I thought about trying to wrap it in winform of my own and run it from there, but my guess is that there may be some parameters I can pass to the command line when running the .exe
file. 我考虑过尝试将其包装到我自己的winform中并从那里运行,但是我猜想可能是在运行
.exe
文件时可以将某些参数传递给命令行。
Is there? 在那儿?
The Win32 API SetWindowLong
( https://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).aspx ) is what supports to change window styling. Win32 API
SetWindowLong
( https://msdn.microsoft.com/zh-cn/library/windows/desktop/ms633591 ( v= SetWindowLong
) SetWindowLong
)支持更改窗口样式。
Command Prompt allows only to change the title of a running application by passing a --title flag. 命令提示符仅允许通过传递--title标志来更改正在运行的应用程序的标题。
However you could try using a Powershell script which has access to Win32 APIs. 但是,您可以尝试使用有权访问Win32 API的Powershell脚本。 Check this example for a starting point.
查看此示例以了解起点。 https://gist.github.com/grenade/ed8dd77ae8eeb5b4a3c1cfd66e9c8ae7
https://gist.github.com/grenade/ed8dd77ae8eeb5b4a3c1cfd66e9c8ae7
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.