Disabling the time changing option in PPC

  • Thread starter Thread starter avanza
  • Start date Start date
A

avanza

hello all,
does .net CF provide ne faclity of restricting the user from chanigng
the date/ time setting of the PPC Device?
 
I use
[DllImport("Coredll.dll")] //Desktop - Kernel32.dll
private static extern bool SetLocalTime(ref SystemTime st);

for changing the System-Time from a DotNet-Application

With the following Code i hide/show the Taskbar:
private const int SW_HIDE = 0x00;

private const int SW_SHOW = 0x0001;

[DllImport("coredll.dll", CharSet = CharSet.Auto)]

private static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);

[DllImport("coredll.dll", CharSet = CharSet.Auto)]

private static extern bool ShowWindow(IntPtr hwnd, int
nCmdShow);

[DllImport("coredll.dll", CharSet = CharSet.Auto)]

private static extern bool EnableWindow(IntPtr hwnd, bool
enabled);

private static void ShowTaskbar()
{

IntPtr h = FindWindow("HHTaskBar", "");

ShowWindow(h, SW_SHOW);

EnableWindow(h, true);

}

private static void HideTaskbar()
{

IntPtr h = FindWindow("HHTaskBar", "");

ShowWindow(h, SW_HIDE);

EnableWindow(h, false);

maybe with this code you have an idea for "locking" the system time ....
 
No, there's no security restriction on changing the time. In fact, every
device has to have its time set any time the battery goes dead, so
restricting access to that capability would make commercial devices like
Pocket PCs useless.

You can change your thought process and, instead of trying to allow the user
to access the whole system, but restrict him from doing some things that you
don't like, you could take over the entire screen, disable the task bar,
etc. and, if he might, in some cases, need to set the time, provide that
capability in your application. Taking over the whole screen like this is
usually called "kiosk mode" and is covered in detail in other messages in
the archives of the group, searchable from GoogleGroups. I also pointed
someone else to a very specific thread with code earlier this morning.

Paul T.
 
Back
Top