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?

Pages: (3): « First « 1 [ 2 ] 3 » Last »
Anyway to automatically set AWAY when computer is lock?
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: Any hotkey to Set Away?
quote:
Originally posted by matty
quote:
Originally posted by Spunky
One of my scripts allows you to do this and is customizable :D

EDIT: If I remember correctly, the Windows WIN+L shortcut to lock the workstation takes priority over any over shortcuts so it may not work to set it to that. You could however set it to WIN+K and do the two shortcuts one after another
I think you misunderstood my code. It just monitors for a locked desktop not the Win+L shortcut key :)

TBH, I didn't really read the code, but it wasn't referring to that anyway. I was just referring to the process of setting a hotkey to something that has already been assigned a windows function.

Also, is
quote:
0. false

a mistake? I've not seen it like that before :p
<Eljay> "Problems encountered: shit blew up" :zippy:
09-29-2010 08:02 PM
Profile PM Find Quote Report
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 Spunky
a mistake? I've not seen it like that before :p
It is new hybrid code! Only 128bit processors can run it :P
09-29-2010 09:41 PM
Profile E-Mail PM Find Quote Report
Bryan84
Junior Member
**


Posts: 62
40 / Male / Flag
Joined: Aug 2006
O.P. RE: RE: Any hotkey to Set Away?
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):
Javascript 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

This post was edited on 09-30-2010 at 03:11 AM by Bryan84.
[Image: signature.gif]
09-30-2010 02:52 AM
Profile E-Mail PM Web Find Quote Report
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):
Javascript 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
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Any hotkey to Set Away?
I haven't tested the code either, but by the looks of it it isn't going to work (or I need some more sleep though... quite possible too)...

bIsDesktopLocked isn't set anywhere, yet is used to be compared with b which is the result of the isDesktopLocked() function.

And what after the desktop is unlocked? It doesn't seem to switch the status back, even if bIsDesktopLocked was set to the previous state of b (unless it was never intended to do, then I'll shut up).

And when the status is Appearing Offline, locking the workstation shouldn't set the status to Idle (or Away).

This post was edited on 09-30-2010 at 03:24 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-30-2010 03:16 AM
Profile PM Find Quote Report
Bryan84
Junior Member
**


Posts: 62
40 / Male / Flag
Joined: Aug 2006
O.P. RE: Any hotkey to Set Away?
I applied that script and something is wrong. My message icon, is flicking between ONLINE and AWAY like CONSTANTLY. LOL. Like it's ON OFF ON OFF ON OFF in seconds!

-edit- then again seems okay now. Weird. So anyway to set the status back to ONLINE automatically when my computer is unlock?

This post was edited on 09-30-2010 at 05:34 AM by Bryan84.
[Image: signature.gif]
09-30-2010 04:27 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Anyway to automatically set AWAY when computer is lock?
Yeah Cookie, I realized late last night that bIsDesktopLocked wasn't being set. Like I said I didn't test the code. I will try and get to it tonight to see.

As for the constant change in status that is weird, I will have to have a look.
09-30-2010 12:25 PM
Profile E-Mail PM Find Quote Report
Bryan84
Junior Member
**


Posts: 62
40 / Male / Flag
Joined: Aug 2006
O.P. RE: RE: Anyway to automatically set AWAY when computer is lock?
quote:
Originally posted by matty
Yeah Cookie, I realized late last night that bIsDesktopLocked wasn't being set. Like I said I didn't test the code. I will try and get to it tonight to see.

As for the constant change in status that is weird, I will have to have a look.

Alright. That on and off problem does not always happen. Just sometimes. Maybe you should make part where it will auto set back to Online when computer is Unlock?
[Image: signature.gif]
09-30-2010 01:01 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Anyway to automatically set AWAY when computer is lock?
I will add an interface around it where you can select the status for the 2 scenarios.
09-30-2010 01:07 PM
Profile E-Mail PM Find Quote Report
Bryan84
Junior Member
**


Posts: 62
40 / Male / Flag
Joined: Aug 2006
O.P. RE: Anyway to automatically set AWAY when computer is lock?
Cool alright! :) Sounds nice!
[Image: signature.gif]
09-30-2010 01:11 PM
Profile E-Mail PM Web Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


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