What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Help » Anyway to automatically set AWAY when computer is lock?

Anyway to automatically set AWAY when computer is lock?
Author: Message:
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Any hotkey to Set Away?
quote:
Originally posted by Bryan84
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! :D

There is a line that I can change if I choose to set as BUSY instead of AWAY? :D
Well currently it would set you to idle if you lock your computer. You can change both the STATUS_IDLE with any of the following
09-30-2010 03:12 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Anyway to automatically set AWAY when computer is lock? - by Bryan84 on 09-28-2010 at 07:51 AM
RE: Any hotkey to Set Away? - by matty on 09-28-2010 at 11:27 AM
RE: Any hotkey to Set Away? - by djdannyp on 09-28-2010 at 04:48 PM
RE: Any hotkey to Set Away? - by matty on 09-28-2010 at 05:37 PM
RE: RE: Any hotkey to Set Away? - by Bryan84 on 09-29-2010 at 08:53 AM
RE: Any hotkey to Set Away? - by CookieRevised on 09-28-2010 at 07:09 PM
RE: Any hotkey to Set Away? - by djdannyp on 09-29-2010 at 11:30 AM
RE: Any hotkey to Set Away? - by matty on 09-29-2010 at 01:31 PM
RE: RE: Any hotkey to Set Away? - by Bryan84 on 09-30-2010 at 02:52 AM
RE: Any hotkey to Set Away? - by Spunky on 09-29-2010 at 02:28 PM
RE: Any hotkey to Set Away? - by matty on 09-29-2010 at 03:55 PM
RE: Any hotkey to Set Away? - by Spunky on 09-29-2010 at 08:02 PM
RE: Any hotkey to Set Away? - by matty on 09-29-2010 at 09:41 PM
RE: Any hotkey to Set Away? - by matty on 09-30-2010 at 03:12 AM
RE: Any hotkey to Set Away? - by CookieRevised on 09-30-2010 at 03:16 AM
RE: Any hotkey to Set Away? - by Bryan84 on 09-30-2010 at 04:27 AM
RE: Anyway to automatically set AWAY when computer is lock? - by matty on 09-30-2010 at 12:25 PM
RE: RE: Anyway to automatically set AWAY when computer is lock? - by Bryan84 on 09-30-2010 at 01:01 PM
RE: Anyway to automatically set AWAY when computer is lock? - by matty on 09-30-2010 at 01:07 PM
RE: Anyway to automatically set AWAY when computer is lock? - by Bryan84 on 09-30-2010 at 01:11 PM
RE: Anyway to automatically set AWAY when computer is lock? - by matty on 10-01-2010 at 12:45 AM
RE: Anyway to automatically set AWAY when computer is lock? - by Bryan84 on 10-01-2010 at 12:51 AM
RE: Anyway to automatically set AWAY when computer is lock? - by matty on 10-01-2010 at 12:59 AM
RE: Anyway to automatically set AWAY when computer is lock? - by Bryan84 on 10-01-2010 at 01:04 AM
RE: Anyway to automatically set AWAY when computer is lock? - by matty on 10-01-2010 at 01:07 AM
RE: Anyway to automatically set AWAY when computer is lock? - by Bryan84 on 10-01-2010 at 01:15 AM
RE: Anyway to automatically set AWAY when computer is lock? - by Bryan84 on 10-09-2010 at 06:31 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On