简体   繁体   English

如何从Windows命令行运行没有标题栏的exe文件?

[英]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文件:

  1. Completely hide the title bar, so that the window won't have any border at all. 完全隐藏标题栏,以使窗口完全没有边框。
  2. Open the window in a split screen mode, so that it will occupy the right side of the screen to allow me to open a second window on the left side. 在分屏模式下打开窗口,以便它将占据屏幕的右侧,以便允许我在左侧打开第二个窗口。

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 SetWindowLonghttps://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.

相关问题 如何从Windows命令行运行python文件(.py)而不必先键入python? - How to run a python file (.py) from the windows command-line without having to type python first? 如何在Windows OS 7中从命令行运行因素文件? - how to run factor file from command line in windows os 7? 使用命令行参数从bat文件运行exe - Run exe from bat file with command line arguments 如何在 Windows 上从命令行运行 clang? - How run clang from command line on Windows? “注册”一个 .exe,以便您可以从 Windows 中的任何命令行运行它 - "Register" an .exe so you can run it from any command line in Windows 如何从一个网站在Windows Server上运行exe文件? - how to run an exe file on windows server from a website thats all? 如何从Windows 8.1商店应用程序运行.exe文件? - How to run .exe file from windows 8.1 store app? 在 Windows 命令行中使用管道运行简单的 Fortran exe - Using piping in Windows command line to run simple Fortran exe 在将参数传递给 PS 文件时,如何使用 invoke-command 从 windows 命令行运行 PS 文件? - How do I use invoke-command to run a PS file from the windows command line while passing parameters to the PS file? 我想从.bat文件运行第3方.exe文件而没有可见的命令提示符 - I want to run a 3rd party .exe file from a .bat file without a visible command prompt
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM