locked
How can I programmatically detect a summer/winter clock change ? RRS feed

  • Question

  • Hi,

    ist there a way of programmatically detecting a summer/winter clock change in the .NET CF ? Somehow I have to find out if a change took place since the last usage of my application (without doing something like if(DateTime.Now > ChangeDateTime)).


    thanx,
    JanZmus
    Tuesday, September 23, 2008 8:47 AM

Answers

  • Hy

    Either PInvoke
    "CeRunAppAtEvent" and check

    NOTIFICATION_EVENT_TIME_CHANGE


    When the system time is changed.
    NOTIFICATION_EVENT_TZ_CHANGE


    When the time zone is changed.

    http://msdn.microsoft.com/en-us/library/ms913956.aspx

    or use

    OpenNETCF.WindowsCE

    http://www.opennetcf.com/library/sdf/html/e6d4ba73-b3bc-4c19-474c-95211da652a6.htm

    void TimeOrTZChanged()
    {
        MessageBox.Show("Device time has been altered");
    }

    void MyForm()
    {
        InitializeComponents();
        DeviceManagement.TimeChanged += TimeOrTZChanged;
        DeviceManagement.TimeZoneChanged += TimeOrTZChanged;
    }

    The sample is from Chris Tacke

    Hope that helps

    Daniel


    Tuesday, September 23, 2008 7:48 PM