PC Review


Reply
Thread Tools Rate Thread

CeSetUserNotificationEx Help Please

 
 
Tia
Guest
Posts: n/a
 
      5th Aug 2009
Hello,

I am using:
Visual Studio 2008, C#
..net Compact Framework 3.5
Mobile 6 SDK
Mobile 6 device

My code compiles fine.
When I test the code with the event set to 3(ac On) or 4(ac Off) nothing
happens when I plug/unplug the power cord.
When I test the code with the event set to 1(time change) it works fine when
I change the date.

Am I doing something wrong???
Any help would be GREATLY appreciated.

Thanks,
Tia


[DllImport("CoreDLL.dll")]
public static extern bool CeRunAppAtEvent(string application, int
EventID);

[DllImport( "coredll.dll" )]
private static extern IntPtr CeSetUserNotificationEx( IntPtr
notification, CE_NOTIFICATION_TRIGGER notificationTrigger,

CE_USER_NOTIFICATION userNotification );

[StructLayout(LayoutKind.Sequential)]
private struct SYSTEMTIME
{
[MarshalAs(UnmanagedType.U2)]
public short Year;
[MarshalAs(UnmanagedType.U2)]
public short Month;
[MarshalAs(UnmanagedType.U2)]
public short DayOfWeek;
[MarshalAs(UnmanagedType.U2)]
public short Day;
[MarshalAs(UnmanagedType.U2)]
public short Hour;
[MarshalAs(UnmanagedType.U2)]
public short Minute;
[MarshalAs(UnmanagedType.U2)]
public short Second;
[MarshalAs(UnmanagedType.U2)]
public short Milliseconds;

public SYSTEMTIME(DateTime dt)
{
dt = dt.ToUniversalTime(); // SetSystemTime expects the
SYSTEMTIME in UTC
Year = (short)dt.Year;
Month = (short)dt.Month;
DayOfWeek = (short)dt.DayOfWeek;
Day = (short)dt.Day;
Hour = (short)dt.Hour;
Minute = (short)dt.Minute;
Second = (short)dt.Second;
Milliseconds = (short)dt.Millisecond;
}
}

private class CE_NOTIFICATION_TRIGGER
{
public UInt32 Size = 0;
public UInt32 Type = 0;
public UInt32 Event = 0;
[MarshalAs(UnmanagedType.LPWStr)]
public string pAppName;
[MarshalAs(UnmanagedType.LPWStr)]
public string pArgs;
public SYSTEMTIME StartTime;
public SYSTEMTIME EndTime;
}

private class CE_USER_NOTIFICATION
{
public UInt32 ActionFlags;
[MarshalAs(UnmanagedType.LPWStr)]
public string pDialogTitle;
[MarshalAs(UnmanagedType.LPWStr)]
public string DialogText;
[MarshalAs(UnmanagedType.LPWStr)]
public string Sound;
public UInt32 MaxSound;
public UInt32 Reserved;
}

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CeSetUserNotificationEx question vkoser Microsoft Dot NET Compact Framework 0 18th Apr 2008 04:20 PM
using CeSetUserNotificationEx =?Utf-8?B?VGFtZXIgSGVzaGFt?= Microsoft Dot NET Compact Framework 1 16th May 2006 02:45 PM
Help! Anyone! Please Please Please Please Please Please =?Utf-8?B?UmFuZHk=?= Microsoft Access Macros 2 17th May 2004 07:16 PM
CeSetUserNotificationEx examples for VB Daniel Lang Microsoft Dot NET Compact Framework 1 7th Dec 2003 05:38 AM
CeSetUserNotificationEx troubles CR6485 Microsoft C# .NET 2 11th Jul 2003 01:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:08 PM.