在Visual Studio 2012控制台应用程序中创建窗口? [英] Create a Window in a Visual Studio 2012 console application?
问题描述
是否可以在C ++控制台应用程序中创建窗口?我已经有一个用于创建一些数据的控制台应用程序,我想在一些图形中显示它们,但不在控制台内部。
Is there a way to create a Window in a C++ Console Application? I have already a console application for creating some data and I want to show them in some graphics, but not inside the console. Is this possible?
推荐答案
您使用了一个名为CreateWindowEx()的函数,请参见此处。
You use a function called CreateWindowEx(), See here.
这很复杂,您需要先创建WNDCLASSEX结构并在其上使用RegisterClassEx(),然后再将其作为参数传递给CreateWindowEx()。您还需要创建消息过程函数。
It's rather complex, you need to create a WNDCLASSEX structure and use RegisterClassEx() on it before passing it as a parameter to CreateWindowEx(). You also need to create Message Procedure function.
在MSDN上的这篇文章很好地贯穿了它
This article on MSDN runs through it quite nicely
这篇关于在Visual Studio 2012控制台应用程序中创建窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!