I am trying to update the dateTimeController in another application using DTM_SETSYSTEMTIME.
bool retVal = false;
ushort GDT_VALID = 0;
SYSTEMTIME td = new SYSTEMTIME();
td.wYear = 1990;
td.wMonth = 4;
td.wDay = 2;
td.wDayOfWeek = 0;
td.wHour = 0;
td.wMilliseconds = 0;
td.wMinute = 0;
td.wSecond = 0;
int erc = SendMessage(handle, DTM_SETSYSTEMTIME, GDT_VALID, ref td);
Unfortunately the attempt was failed, the picker is not updated, every time return value is zero. Important thing is occasionally the application having the dataTimePicker gives an error message that illegal memory access exception after I execute the SendMessage command.
Can anybody help me to fix this up ?
Your information is really helpful for me to fix my issue. Following is the code.
Method is called by,