The WINDOWS subsystem handles an application that does not require a console and creates its own windows, if required#pragma comment(linker, "/subsystem:Windows, 4") or #pragma comment(linker, "/subsystem:Windows, 5")
to idAnts(你才无聊呢) :你说的方法是可以隐藏窗口,但我在把程序设置为开机后运行后,每次都仍然显示出窗口,只是在手动启动的情况下才能隐藏窗体,是什么原因呢? 还有各位,请指教啊!
HANDLE hwnd = FindWindow(NULL,"testMyConsole");
ShowWindow((HWND)hwnd,SW_HIDE);
Sleep(5000);
ShowWindow((HWND)hwnd,SW_SHOW);
or
#pragma comment(linker, "/subsystem:Windows, 5")
还有各位,请指教啊!
#include <mmsystem.h> #pragma comment(lib,"winmm.lib") // 告诉连接器与这个库连接,因为我们要播放多媒体声音
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) // 设置连接器选项 int main(void)
{
PlaySound("SystemStart",NULL, SND_ALIAS|SND_SYNC);
Sleep(50);
PlaySound("SystemStart",NULL, SND_ALIAS|SND_SYNC);
Sleep(50);
PlaySound("SystemStart",NULL, SND_ALIAS|SND_SYNC);
Sleep(50); return 0;
}
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
是什么意思?