Shoutbox

DateTimeControl - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: DateTimeControl (/showthread.php?tid=62212)

DateTimeControl by NiteMare on 07-01-2006 at 05:33 AM

I stumped the might -dt- on this one:

How do i set the value for a DateTimeControl, from inside the script?

the SetControlText doesn't work, the GetControlText works, to grab the info, but set doesn't?


RE: DateTimeControl by Mnjul on 07-01-2006 at 07:59 AM

My guess is that you need to send DTM_SETSYSTEMTIME message. :)

More information: http://msdn.microsoft.com/library/en-us/shellcc/p..._setsystemtime.asp


RE: DateTimeControl by NiteMare on 07-01-2006 at 08:02 AM

quote:
Originally posted by Mnjul
My guess is that you need to send DTM_SETSYSTEMTIME message. :)

More information: http://msdn.microsoft.com/library/en-us/shellcc/p..._setsystemtime.asp
cool, thanks
i'm not really that good at understanding those things, can you give me an example to learn from?
RE: DateTimeControl by Eljay on 07-01-2006 at 08:46 AM

after a lot of testing and swearing this works :P

code:
var DTM_SET_SYSTEMTIME = 0x1002;
var GDT_VALID = 0;

var SysTimeStruct = Interop.Allocate(16);
SysTimeStruct.WriteWORD(0, 2006); //Year
SysTimeStruct.WriteWORD(2, 1); //Month (1-12)
SysTimeStruct.WriteWORD(4, 6); //Day Of Week (0-6 = Sunday-Saturday)
SysTimeStruct.WriteWORD(6, 1); //Day Of Month (1-31)
SysTimeStruct.WriteWORD(8, 12); //Hour (0-23)
SysTimeStruct.WriteWORD(10, 12); //Minute (0-59)
SysTimeStruct.WriteWORD(12, 12); //Second (0-59)
SysTimeStruct.WriteWORD(14, 500); //Millisecond (0-999)

PlusWnd.SendControlMessage('DateTimeControlId', DTM_SET_SYSTEMTIME, GDT_VALID, SysTimeStruct.DataPtr);

RE: DateTimeControl by NiteMare on 07-01-2006 at 09:52 AM

The time doesn't work:(