WINAPI和CWnd SendMessage之间的区别 [英] Difference between WINAPI and CWnd SendMessage

查看:101
本文介绍了WINAPI和CWnd SendMessage之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到有2个版本的sendMessage()



在CWnd类下面,另一个是WINAPI



我在MSDN上找到了2 sendMesage的原型。



 LRESULT WINAPI SendMessage(
HWND hWnd,
UINT消息,
WPARAM wParam,
LPARAM lParam
);

CWnd :: LRESULT SendMessage(
UINT消息,
WPARAM wParam = 0
LPARAM lParam = 0
);





问题:

1.这两者之间的区别是什么?

2.在什么情况下使用哪种版本?(一个例子很好)

3。对于CWnd类verision,那是hWnd发送? (默认情况下是发送消息的对象的hWnd吗?)



谢谢〜

解决方案

chronoseraph写道:

1.这两者有什么区别?



一个属于Windows API和另一个是MFC版本。



chronoseraph写道:

2 。在什么情况下使用哪个verision?(一个例子会很好)



如果你正在使用MFC,你也可以使用MFC版本......它''无论如何,当你在这种情况下通常更容易使用。



chronoseraph写道:

3.对于CWnd类verision,那是hWnd发送? (默认情况下是发送消息的对象的hWnd吗?)



它使用与特定cwnd对象相对应的hwnd。如果你不知道hwnd和cwnd之间的区别,那就是一个完整的袋子o蠕虫。



希望有所帮助。 / blockquote>

这将对您有所帮助。仔细阅读

http://www.differencebetween.net/技术/差-MFC之间- - 和 - 的win32 /

I noticed that there is 2 verision of sendMessage()

one under the CWnd class, and another uder the WINAPI

I found the prototype of the 2 sendMesage on MSDN.

LRESULT WINAPI SendMessage(
	HWND hWnd,
	UINT Msg,
	WPARAM wParam,
	LPARAM lParam
);

CWnd::LRESULT SendMessage(
	UINT message,
	WPARAM wParam = 0,
	LPARAM lParam = 0 
);



Question:
1.What is the difference between these two?
2.Which verision is used under what situation?( an example would be nice)
3.For the CWnd class verision, that is the hWnd send? ( does it default to the hWnd of the object that sends the message?)

Thanks ~

解决方案

chronoseraph wrote:

1.What is the difference between these two?


One belongs to the Windows API and the other is the MFC version.

chronoseraph wrote:

2.Which verision is used under what situation?( an example would be nice)


If you''re using MFC, you might as well use the MFC version... it''s usually easier to use when you''re in that context anyway.

chronoseraph wrote:

3.For the CWnd class verision, that is the hWnd send? ( does it default to the hWnd of the object that sends the message?)


It uses the hwnd that corresponds to the particular cwnd object. If you don''t know the difference between hwnd and cwnd, that''s a whole-nother bag-o-worms.

Hope that helps a bit.


This will help you. Read it carefuly
http://www.differencebetween.net/technology/difference-between-mfc-and-win32/


这篇关于WINAPI和CWnd SendMessage之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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