关于接收:
Receive WM_COPYDATA messages in a Qt app.
还有个中文网站:
关于发送:
用Qt在Windows下编程,如何调用Windows系统的API?
稍后会把内容补上
后来,Qt5把winEvent函数废弃掉了,换成bool QWidget::nativeEvent(const QByteArray & eventType, void * message, long * result)函数了:
这里有个举例子
http://blog.csdn.net/slug302/article/details/17212521
bool MainDialog::nativeEvent(const QByteArray &eventType, void *message, long *result)
{
Q_UNUSED(eventType);
MSG* msg = reinterpret_cast<MSG*>(message);
return winEvent(msg, result);
}
bool MainDialog::winEvent(MSG *message, long *result)
{
...
if (message->message != WM_NCHITTEST )
{
#if QT_VERSION < 0x050000
return QDialog::winEvent(message, result);
#else
return QDialog::nativeEvent("", message, result);
#endif
}
...
}
本文探讨了如何在Qt应用程序中实现类似MFC的消息处理机制,并提供了在Qt中使用Windows API来接收和发送WM_COPYDATA消息的具体示例。此外,还介绍了Qt5中winEvent函数被废弃后的新替代方案。
MFC或Windows消息(message)&spm=1001.2101.3001.5002&articleId=7406861&d=1&t=3&u=deea21f981d249be8ef965ef0e7b0f4f)
3408

被折叠的 条评论
为什么被折叠?



