LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to connected to the Internet and change system date/time?

Hello
I want to know if my computer is currently connected to the Internet.
So I'm looking for several related functions. But I could not find it.

 

And I want to change the date/time on my computer. I have tried the following functions:

SetSystemDate();
SetSystemTime();

I changed it on my development PC. However, after making it as a distribution, it was not changed on the Panel PC.
The OS of the Panel PC is Windows 7 Embeded.
I want to know if there is another way to change the date and time.

 

Thank you.

0 Kudos
Message 1 of 3
(2,418 Views)

Hi,

The SetSystemTime() should work on windows 7 embedded. It may be required to use EnableSetTime() first. Also make sure that the user has the privilege to change the computer time.

 

We use the following code snippet:

  if(EnableSetTime())
  {
   // Change the computer time.
   setTime=SetSystemTime(&newTime);
   if (setTime)
   {
    // Tell all panels that time changed
    SendMessage(HWND_BROADCAST, WM_TIMECHANGE,0,0);
    DisableSetTime();
   }
  }

 

0 Kudos
Message 2 of 3
(2,386 Views)

Hi.
Thank you for reply.
I tried the way you suggested. But I can not find the "EnableSetTime ()" function.
It is not defined anywhere.
I think user do not have the privilege to change the computer time.
I would like to know how to change the permissions on the Windows 7 Embedded OS so that the user can change the time.
Thank you very much.

0 Kudos
Message 3 of 3
(2,345 Views)