首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请教怎么输出EVENTMSG里的内容

2013-07-01 
请问如何输出EVENTMSG里的内容? ArrayList msgList new ArrayList()EVENTMSG curMSG nulltry{curMSG

请问如何输出EVENTMSG里的内容?
 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里的内容?
[解决办法]
那你要显示哪个字段就显示哪个字段呗:
Console.Write(curMSG.message)
[解决办法]

引用:
Quote: 引用:

EVENTMSG这个类里面的代码贴出来看看

   [StructLayout(LayoutKind.Sequential)]
    public class EVENTMSG
    {
        public UInt32 message;
        public UInt32 paramL;
        public UInt32 paramH;
        public Int32 time;
        public UIntPtr hwnd;
    }


查查看,有没有关于EVENTMSG的文档, ID对应详细信息的。ID就是这里面的UInt32 message.

热点排行