public CE_NOTIFICATION_TRIGGER(byte[] Buf, uint Size, ref int Index) { int iEndOfString; System.Text.UnicodeEncoding enc = new UnicodeEncoding(); uint lpszApp = 0; uint lpszArgs = 0; this.Size = BitConverter.ToUInt32(Buf, Index); Index += 4; this.Type = (CeNotificationType)BitConverter.ToUInt32(Buf, Index); Index += 4; this.Event = (CeNotificationEvent)BitConverter.ToUInt32(Buf, Index); Index += 4; lpszApp = BitConverter.ToUInt32(Buf, Index); Index += 4; lpszArgs = BitConverter.ToUInt32(Buf, Index); Index += 4; this.StartTime = new SYSTEMTIME(Buf, Index); Index += 16; this.EndTime = new SYSTEMTIME(Buf, Index); Index += 16; if (lpszApp > 0) { iEndOfString = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size); this.pApplication = enc.GetString(Buf, Index, iEndOfString - Index - 2); Index = iEndOfString; } if (lpszArgs > 0) { iEndOfString = WinCE.WinCE.findEndOfString(Buf, Index, (int)Size); this.pArgs = enc.GetString(Buf, Index, iEndOfString - Index - 2); // Stupid solution to double null ending.. Index = iEndOfString; } }