title: Setting the time programmatically in Windows 7
body: <p>I'm porting an application from Windows 2000 (don't ask) to Windows 7 and I need to replicate functionality that allows the user to set the time from a GUI. Previously this had been done with a call directly to 'time' using the command prompt, but it appears the user permissions have changed somewhat in Windows 7.</p>
  
  <p>Having done some research, it appears that you can set the time using a call to the <code>kernel32.dll</code> method <code>Win32SetSystemTime</code>, but the same permissions issue arises. Reading MSDN I think I need to enable <code>SE_SYSTEMTIME_NAME</code>, however no matter what I try I can't seem to make this work.</p>
  
  <p>Does anyone have some tested example code for Windows 7 to allow an API call to <code>Win32SetSystemTime</code>?</p>