如何使一个简单的Hello World"不可见QUOT;在Windows(C / C ++) [英] How to make a simple Hello World "invisible" in Windows (C/C++)

查看:155
本文介绍了如何使一个简单的Hello World"不可见QUOT;在Windows(C / C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好那里,我想知道是否有可能在Windows中做一个简单的Hello World程序(然后推进到实际的)不可见。我的意思是,当我执行该程序不会有图形指示任何责任。没有CMD打印的Hello world时,没有任务栏标签,没有系统托盘图标,什么都没有。我想程序,而不会打扰我安静地执行。

Hello there i would like to know if it is possible to make a simple Hello World program in Windows (and then advance to actual ones) invisible. By that I mean, when I execute the program there will be no graphical indication whatsoever. No cmd printing "Hello world", no taskbar label, no system tray icon,nothing. I want the program to execute silently without bothering me.

那么,我想这里的人?是不是可行?难道是像一个服务?我不知道。

So what am I thinking here people? Is that doable? Would it be like a service? I have no idea.

我想code在C / C ++ BTW。

I would like to code it in C/C++ btw.

推荐答案

你如何处理这个要看你有什么样的Windows应用程序。

How you deal with this depends on the kind of Windows application you have.

如果你想有一个程序,当您启动和停止时关闭,然后追求编写Windows服务,这是可行的,但并不像写一个普通用户模式应用程序一样简单运行。调试服务,关键在于普通的应用程序和设备驱动程序之间的某处,更像是一个应用程序,但你必须使用微软的模板钩子,这样你可以得到控制的调试。

If you want a program to run when you boot and stop when you shut down, then pursue writing a Windows Service, which is doable, but is not as simple as writing a regular user-mode application. Debugging a service lies somewhere in between a regular application and a device driver, more like an application, but you have to use Microsoft template hooks so you can gain debugging control.

如果你只是想一个无声的控制台,它是一个Windows应用程序(主窗口和所有的),您可以创建窗口,因此它不会最初显示。

If you simply want a silent console and it's a Windows application (main window and all that) you can create the window so it does not display initially.

如果它是一个控制台应用程序,你应该能够将控制台重定向的输出。有Win32的库函数来操纵控制台,包括关闭窗口,这样应用程序可以运行静默。下面是这些功能的链接。

If it is a console application, you should be able to redirect the output of the console. There are Win32 library routines to manipulate a console, including closing the window, so the application can run "silently". Here is a link to those functions.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682073%28v=vs.85%29.aspx

这篇关于如何使一个简单的Hello World"不可见QUOT;在Windows(C / C ++)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆