获得键盘和鼠标输入的CWnd [英] CWnd that gets Keyboard and mouse input

查看:125
本文介绍了获得键盘和鼠标输入的CWnd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个获取键盘和鼠标输入的CWnd对象,但是我不想使用"EDIT"的WNDCLASS,因为这并不总是一个编辑.我希望它可以成为所有者抽奖.

I''d like to create a CWnd object that gets keyboard and mouse input, but I don''t want to use the WNDCLASS of "EDIT" because this won''t always be an edit. I want it to be owner draw.

// Something like this, but don''t want to use "EDIT"
CRect Pos(50,200,200,220);
MyWnd.Create(_T("EDIT"),_T("MyInputWnd),WS_CHILD | WS_VISIBLE, Pos, this,1);



AfxRegisterClass()似乎很复杂(我错了吗?),但这是唯一的方法吗?

有任何想法吗?更好的代码片段了吗?

在此先谢谢您.



AfxRegisterClass() seems pretty complicated (am I wrong?), but is this the only way to do this?

Any ideas? Better yet any code snippets?

Thanks in advance.

推荐答案

它确实没有那么复杂.这是一个基于CWnd的编辑器: CUltraPadWnd-基于MFC CWnd类的简单语法着色控件 [ ^ ]
It really is not that complicated. Here is an editor based on CWnd: CUltraPadWnd - A Simple Syntax Coloring Control Based on the MFC CWnd Class[^]


这篇关于获得键盘和鼠标输入的CWnd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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