Example #1
0
            public CE_USER_NOTIFICATION(byte[] Buf, uint Size, ref int Index)
            {
                int iEndOfString;

                System.Text.UnicodeEncoding enc = new UnicodeEncoding();

                this.ActionFlags = (PUN_FLAGS)BitConverter.ToUInt32(Buf, Index);
                Index           += 4;
                uint lpszDialogTitle = BitConverter.ToUInt32(Buf, Index);

                Index += 4;
                uint lpszDialogText = BitConverter.ToUInt32(Buf, Index);

                Index += 4;
                uint lpszSound = BitConverter.ToUInt32(Buf, Index);

                Index         += 4;
                this.nMaxSound = BitConverter.ToUInt32(Buf, Index);
                Index         += 4;
                // read Reserved
                Index += 4;
                if (lpszDialogTitle > 0)
                {
                    iEndOfString      = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size);
                    this.sDialogTitle = enc.GetString(Buf, Index, iEndOfString - Index - 2);
                    Index             = iEndOfString;
                }
                if (lpszDialogText > 0)
                {
                    iEndOfString     = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size);
                    this.sDialogText = enc.GetString(Buf, Index, iEndOfString - Index - 2);
                    Index            = iEndOfString;
                }
                if (lpszSound > 0)
                {
                    iEndOfString = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size);
                    this.sSound  = enc.GetString(Buf, Index, iEndOfString - Index - 2);
                    Index        = iEndOfString;
                }
            }
            public CE_USER_NOTIFICATION(byte[] Buf, uint Size, ref int Index)
            {
                int iEndOfString;
                System.Text.UnicodeEncoding enc = new UnicodeEncoding();

                this.ActionFlags = (PUN_FLAGS)BitConverter.ToUInt32(Buf, Index);
                Index += 4;
                uint lpszDialogTitle = BitConverter.ToUInt32(Buf, Index);
                Index += 4;
                uint lpszDialogText = BitConverter.ToUInt32(Buf, Index);
                Index += 4;
                uint lpszSound = BitConverter.ToUInt32(Buf, Index);
                Index += 4;
                this.nMaxSound = BitConverter.ToUInt32(Buf, Index);
                Index += 4;
                // read Reserved
                Index += 4;
                if (lpszDialogTitle > 0)
                {
                    iEndOfString = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size);
                    this.sDialogTitle = enc.GetString(Buf, Index, iEndOfString - Index - 2);
                    Index = iEndOfString;
                }
                if (lpszDialogText > 0)
                {
                    iEndOfString = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size);
                    this.sDialogText = enc.GetString(Buf, Index, iEndOfString - Index - 2);
                    Index = iEndOfString;
                }
                if (lpszSound > 0)
                {
                    iEndOfString = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size);
                    this.sSound = enc.GetString(Buf, Index, iEndOfString - Index - 2);
                    Index = iEndOfString;
                }
            }