I'm porting a linux app on windows and I need dbus-daemon.exe running on my win session.
我正在Windows上移植一个Linux应用程序,我需要在我的win会话上运行dbus-daemon.exe。
My app and dbus-daemon.exe work fine but the latter still opens a default console and, being not familiar with programming on windows, I don't know how to get rid of it.
我的应用程序和dbus-daemon.exe工作正常,但后者仍然打开一个默认控制台,不熟悉Windows上的编程,我不知道如何摆脱它。
Maybe by making it invisible ?
也许让它看不见?
1 个解决方案
#1
0
Windows, by default, opens a console window for executables compiled for the console subsystem (the "subsystem" being essentially a bit of metadata in the Portable Executable format, aka EXE/DLL). So you have at least two options:
默认情况下,Windows会打开一个控制台窗口,用于为控制台子系统编译的可执行文件(“子系统”本质上是可移植可执行文件格式的一些元数据,即EXE / DLL)。所以你至少有两个选择:
- Compile the
dbus-daemon
for the Windows subsystem, if you're the one doing the compilation. It is a linker option. - Launch the
dbus-daemon
process passing theCREATE_NO_WINDOW
flag to the relevant API function (probablyCreateProcess
). If you're not using the Windows API directly, look howCreateProcess
andCREATE_NO_WINDOW
are exposed in the API you are using. In .NET, for example, it's theProcessStartInfo.CreateNoWindow
property.
如果您正在进行编译,请编译Windows子系统的dbus-daemon。它是一个链接器选项。
启动dbus-daemon进程,将CREATE_NO_WINDOW标志传递给相关的API函数(可能是CreateProcess)。如果您没有直接使用Windows API,请查看您正在使用的API中如何公开CreateProcess和CREATE_NO_WINDOW。例如,在.NET中,它是ProcessStartInfo.CreateNoWindow属性。
#1
0
Windows, by default, opens a console window for executables compiled for the console subsystem (the "subsystem" being essentially a bit of metadata in the Portable Executable format, aka EXE/DLL). So you have at least two options:
默认情况下,Windows会打开一个控制台窗口,用于为控制台子系统编译的可执行文件(“子系统”本质上是可移植可执行文件格式的一些元数据,即EXE / DLL)。所以你至少有两个选择:
- Compile the
dbus-daemon
for the Windows subsystem, if you're the one doing the compilation. It is a linker option. - Launch the
dbus-daemon
process passing theCREATE_NO_WINDOW
flag to the relevant API function (probablyCreateProcess
). If you're not using the Windows API directly, look howCreateProcess
andCREATE_NO_WINDOW
are exposed in the API you are using. In .NET, for example, it's theProcessStartInfo.CreateNoWindow
property.
如果您正在进行编译,请编译Windows子系统的dbus-daemon。它是一个链接器选项。
启动dbus-daemon进程,将CREATE_NO_WINDOW标志传递给相关的API函数(可能是CreateProcess)。如果您没有直接使用Windows API,请查看您正在使用的API中如何公开CreateProcess和CREATE_NO_WINDOW。例如,在.NET中,它是ProcessStartInfo.CreateNoWindow属性。