matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Away since....
Something like this: js code: var LOCALE_USER_DEFAULT = 0x400;
var TIME_NOSECONDS = 0x2;
function OnEvent_MyStatusChange(nStatus) {
var oStatus = { STATUS_ONLINE : 'Online',
STATUS_BUSY : 'Busy',
STATUS_AWAY : 'Away',
STATUS_IDLE : 'Idle',
STATUS_INCALL : 'On the phone',
STATUS_OUTLUNCH : 'Out to lunch'
}
if (typeof oStatus[nStatus] === 'object') {
var SYSTEMTIME = Interop.Allocate(16);
var sTime = Interop.Allocate(512);
var sDate = Interop.Allocate(512);
Interop.Call('kernel32', 'GetSystemTime', SYSTEMTIME);
Interop.Call('kernel32', 'GetTimeFormatW', LOCALE_USER_DEFAULT, TIME_NOSECONDS, SYSTEMTIME, 0, sTime, sTime.Size);
Interop.Call('kernel32', 'GetDateFormatW', LOCALE_USER_DEFAULT, 0, SYSTEMTIME, 0, sDate, sDate.Size);
Messenger.MyPersonalMessage = oStatus[nStatus]+ ' since '+sDate.ReadString(0) +' '+sTime.ReadString(0);
}
}
This post was edited on 12-01-2009 at 03:22 PM by matty.
|
|