在主win32窗口中创建窗口控制台 [英] Create window console inside main win32 window

查看:279
本文介绍了在主win32窗口中创建窗口控制台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个win32应用程序,需要打开一个控制台像游戏时按下tilde。我认为最好的解决方案是使用CreateWindow函数。这是正确的吗?我怎么能使它重叠在主窗口和隐藏它,当波浪号再次按下?谢谢大家

I have a win32 application that need to open a console like the games when tilde is pressed. I tought that the best solution is to use the CreateWindow function. Is this right? How could I make it overlapping the main window and hiding it when tilde is pressed again? Thank you all

推荐答案

在您的应用程序中使用控制台窗口常常很诱人(使用 AllocConsole ),但它绝对不是一个标准的可重用的Windows控件。它有很多特殊的行为和功能,使它从一个典型的窗口是独一无二的。

It's often tempting to use a console window in your app (using AllocConsole), but it is definitely NOT a standard reusable Windows control. It has a lot of special behaviors and features which make it unique from a typical window.

因为这个原因,我同意你的直觉,反对使用一个真正的控制台'窗口。

For this reason, I would agree with your instinct, against using a true 'Console' window. Make your own window with a text editor in it, as you would develop any other UI component like a HUD.

是否应该使用 CreateWindow

Whether you should use CreateWindow is hard to say: how are you doing the rest of your GUI? DirectX? GDI? Some toolkit? Are you using other standard windows controls?

这篇关于在主win32窗口中创建窗口控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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