最简单的方法来创建一个HWND [英] Simplest way to create a HWND

查看:1124
本文介绍了最简单的方法来创建一个HWND的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在MSVC ++中的虚拟窗口,这将永远不可见,甚至在应用程序的主窗口之前创建。它是渲染引擎需要的。所以我宁愿不必注册一个类如果可能。

I need a dummy window in MSVC++, this will never be visible and is created even before the app's main window. It's required by a rendering engine. So I'd rather not have to register a class if possible.

对于测试,最好是让它可见,以证明它是 - 我可以使用静态或按钮或东西?我一直在尝试CreateWindow(),但是当我得到一个返回值,没有可见的出现。

For testing it would be better to make it visible to prove it is there - can I use a static or a button or something? I've been trying with CreateWindow() but while I am getting a return value, nothing visible is appearing.

推荐答案

我自己的测试代码critique:

I submit my own test code for critique:

HWND dummyHWND = ::CreateWindowA("STATIC","dummy",WS_VISIBLE,0,0,100,100,NULL,NULL,NULL,NULL);
::SetWindowTextA(dummyHWND,"Dummy Window!");

似乎工作...

这篇关于最简单的方法来创建一个HWND的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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