quote:
Originally posted by matty
Well I could easily create a script to set the status to Idle when you lock your computer. That is simple.
Something like this could work (untested by the way):
js code:
var bIsDesktopLocked;
var nPreStatus = 0;
function OnEvent_Initialize() {
if (Messenger.MyStatus < STATUS_INVISIBLE) return false;
MsgPlus.AddTimer('isDesktopLocked()', 100);
}
function OnEvent_SigninReady() {
OnEvent_Initialize();
}
function OnEvent_Timer(sTimerId) {
var b = isDesktopLocked();
var n = Messenger.MyStatus;
if(b !== bIsDesktopLocked) {
if(Messenger.MyStatus !== STATUS_IDLE &&
Messenger.MyStatus !== nPreStatus) {
Messenger.MyStatus = (b ? STATUS_IDLE : nPreStatus);
nPreStatus = n;
}
}
MsgPlus.AddTimer(sTimerId, 100);
}
function isDesktopLocked() {
var DESKTOP_SWITCHDESKTOP = 0x100;
var p_lngHwnd = Interop.Call('user32', 'OpenDesktopW', 'Default', 0, false, DESKTOP_SWITCHDESKTOP);
if(p_lngHwnd !== 0)
var p_lngRtn = Interop.Call('user32', 'SwitchDesktop', p_lngHwnd);
Interop.Call('user32', 'CloseDesktop', p_lngHwnd);
return p_lngRtn === 0;
}
Thanks! Exactly best of what I wanted!
There is a line that I can change if I choose to set as BUSY instead of AWAY?