请问如何输出EVENTMSG里的内容?

liyifei1234 2013-06-26 05:36:13
ArrayList msgList = new ArrayList();
EVENTMSG curMSG = null;
try
{
curMSG = (EVENTMSG)Marshal.PtrToStructure(lParam, typeof(EVENTMSG));
}
catch (Exception e)
{
MessageBox.Show(e.ToString());
}
msgList.Add(curMSG);
如果这个输出的话Console.Write(curMSG.ToString());总是输出"EVENTMSG"
请问如何输出EVENTMSG curMSG里的内容?
...全文
235 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
引用 2 楼 liyifei1234 的回复:
[quote=引用 1 楼 u011130289 的回复:] EVENTMSG这个类里面的代码贴出来看看
[StructLayout(LayoutKind.Sequential)] public class EVENTMSG { public UInt32 message; public UInt32 paramL; public UInt32 paramH; public Int32 time; public UIntPtr hwnd; }[/quote] 查查看,有没有关于EVENTMSG的文档, ID对应详细信息的。ID就是这里面的UInt32 message.
liyifei1234 2013-06-26
  • 打赏
  • 举报
回复
引用 3 楼 ojlovecd 的回复:
那你要显示哪个字段就显示哪个字段呗: Console.Write(curMSG.message)
输出的内容不是512就是514,256,257这些是二进制的内容吗?
我姓区不姓区 2013-06-26
  • 打赏
  • 举报
回复
那你要显示哪个字段就显示哪个字段呗: Console.Write(curMSG.message)
liyifei1234 2013-06-26
  • 打赏
  • 举报
回复
引用 1 楼 u011130289 的回复:
EVENTMSG这个类里面的代码贴出来看看
[StructLayout(LayoutKind.Sequential)] public class EVENTMSG { public UInt32 message; public UInt32 paramL; public UInt32 paramH; public Int32 time; public UIntPtr hwnd; }
Regan-lin 2013-06-26
  • 打赏
  • 举报
回复
EVENTMSG这个类里面的代码贴出来看看

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧