3

I'm working on an embedded software, where we would like to avoid exposing Windows features and interfaces as much as possible. However, users need the ability to change the system date and time, and perhaps also timezone or daylight saving mode.

I thought I would create our own simple Form for that and I tried digging into Win32 API calls, but realized that it's not a simple way.

So I found that basically the easiest way here would be to invoke the well-known Windows dialog from the software and let users changing stuff there. I couldn't find anything about it so far. Is there any executable for it (such as gpedit.msc for example), or is there any API calls to show that window? If not, or in case of any contras which I didn't take into count, can anyone suggest a better way for this task?

EDIT: Thank you for the timedate.cpl tip, I will try it as soon as I can.

Zoltán Tamási
  • 10,479
  • 3
  • 51
  • 73

3 Answers3

3

On my desktop version of Windows you can show that dialog by executing timedate.cpl. I've no idea whether or not that will work on your embedded Windows.

David Heffernan
  • 572,264
  • 40
  • 974
  • 1,389
  • It is working in our embedded environment as well, however, I have no idea on which package it depends on. But for now it doesn't matter. Thank you. – Zoltán Tamási Apr 15 '13 at 13:14
2

Yes there is. Use this code and upon button clicking it will work:

System.Diagnostics.Process.Start("timedate.cpl");

It should work. If you want to open other windows controls you only have to change "timedata.cpl" to the command of your choice.

Good Luck!

sth
  • 200,334
  • 49
  • 262
  • 354
Ngatia Frankline
  • 2,092
  • 2
  • 13
  • 15
1

Try this:

Process.Start(System.Environment.SystemDirectory + @"\TimeDate.cpl");

But I don't know if it works on your embedded Windows...

Sébastien Garmier
  • 1,243
  • 9
  • 16