The calling process must have the SE_SYSTEMTIME_NAME privilege. This privilege is disabled by default. The
SetLocalTime function enables the SE_SYSTEMTIME_NAME
privilege before changing the local time and disables the privilege
before returning. For more information, see
Running with Special Privileges.
I would to write SetLocalTime() on the title and not GetSystemTime().
And Yes, i do a google search before ask here... but i just found about how to use GetSystemTime()/GetLocalTime() in mql4, but nothing aboutSetSystemTime()/SetSystemTime().
How can import the dll call i know, but i cannot know how to format the date value to send to the SetLocalTime()function. Below in this thread has a code that i trying to make...
For the record, here a code to get system and local time from DLL... I think this is irrelevant because we have TimeLocal() and TimeGMT() to get those values.... but it's a good exercise.
Here a code that i am trying to change computer local time, but not works:
Ok, thanks... I'm sorry for my mistake.
I would to write SetLocalTime() on the title and not GetSystemTime().
And Yes, i do a google search before ask here... but i just found about how to use GetSystemTime()/GetLocalTime() in mql4, but nothing about SetSystemTime()/SetSystemTime().
How can import the dll call i know, but i cannot know how to format the date value to send to the SetLocalTime() function. Below in this thread has a code that i trying to make...
For the record, here a code to get system and local time from DLL... I think this is irrelevant because we have TimeLocal() and TimeGMT() to get those values.... but it's a good exercise.
Here a code that i am trying to change computer local time, but not works:
Hi there,
I know the topic is too old but just in case I would like to note here :
As you see on "https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types" the WORD type is unsigned short.
This works for me, on Windows 10 64 bit , MetaTrader version 4.00 build 1345, MetaEditor version : 5.00 build 2387