What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Request] Minimize to tray on focus contact window with a hotkey

Pages: (4): « First [ 1 ] 2 3 4 » Last »
[Request] Minimize to tray on focus contact window with a hotkey
Author: Message:
warmth
Veteran Member
*****

Avatar
Electronic Engineer

Posts: 1730
Reputation: 26
39 / Male / Flag
Joined: Jul 2003
O.P. [Request] Minimize to tray on focus contact window with a hotkey
Can someone make a script that simulate the ESC behavior in convo windows but in contact windows???

When you have the focus on the contact windows and press ESC then this one get minimized to try icon... (H)
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
04-16-2007 10:41 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Request] Minimize to tray on focus contact window with a hotkey
code:
var VK_ESC = 0xA;
var WM_CLOSE = 0x10;
function OnEvent_Initialize(bMessengerStart){
    MsgPlus.AddTimer('_minimize_window', 100);
}

function OnEvent_Timer(sTimerId){
    if (Interop.Call('user32', 'GetForegroundWindow') === Messenger.ContactListWndHandle){
        if (Interop.Call('user32', 'GetAsyncKeyState', VK_ESC) !== 0){
            Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, WM_CLOSE, 0, 0);
        }
    }
    MsgPlus.AddTimer(sTimerId, 100);
}

Something like that.....

This post was edited on 04-18-2007 at 01:24 AM by matty.
04-17-2007 05:54 PM
Profile E-Mail PM Find Quote Report
warmth
Veteran Member
*****

Avatar
Electronic Engineer

Posts: 1730
Reputation: 26
39 / Male / Flag
Joined: Jul 2003
O.P. RE: [Request] Minimize to tray on focus contact window with a hotkey
sorry doesnt work for me mate...

This post was edited on 04-18-2007 at 03:16 PM by warmth.
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
04-18-2007 03:10 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Request] Minimize to tray on focus contact window with a hotkey
I wasn't at home when I coded this so I wasn't able to test it. However it is fixed!

code:
/*
    This is a simple script to detect when the user presses the
    escape key, the Messenger Contactlist will close.
   
    Coded by Matty
    Request from: http://shoutbox.menthix.net/showthread.php?tid=73662
*/


function OnEvent_Initialize(bMessengerStart){
    /* Create a timer to monitor the window and the keys pressed */
    MsgPlus.AddTimer('_minimize_window', 100);
}

function OnEvent_Timer(sTimerId){
    /* Check to see if the contactlist is the focused window */
    if (Interop.Call('user32', 'GetForegroundWindow') === Messenger.ContactListWndHandle){
        /* Check to see if we press the escape key */
        if (Interop.Call('user32', 'GetAsyncKeyState', 0x1b /* VK_ESC */) !== 0){
            /*
                Looks like we pressed the escape key, so lets close the window
                We send a WM_CLOSE to the window using the SendMessageW api
            */

            Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0x10 /* WM_CLOSE */, 0, 0);
        }
    }
    /* Readd the timer no matter what so that we can keep monitoring the windows */
    MsgPlus.AddTimer('_minimize_window', 100);
}

This post was edited on 04-18-2007 at 06:38 PM by matty.
04-18-2007 06:38 PM
Profile E-Mail PM Find Quote Report
warmth
Veteran Member
*****

Avatar
Electronic Engineer

Posts: 1730
Reputation: 26
39 / Male / Flag
Joined: Jul 2003
O.P. RE: [Request] Minimize to tray on focus contact window with a hotkey
now it works, thanks a lot matty... how about to do an interface where you can choose the hotkey??? maybe this can be very usefull for other people here but no with the ESC key...

after testing I have somethings to tell u...

to have a timer like that always working doesn't cause memory leaks???

and there is a problem... when you have only a convo opened and the contact list and press ESC the convo get closed and the contact list too... cause it got the focus...

This post was edited on 04-19-2007 at 03:11 AM by warmth.
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
04-18-2007 08:14 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Request] Minimize to tray on focus contact window with a hotkey
quote:
Originally posted by warmth
now it works, thanks a lot matty... how about to do an interface where you can choose the hotkey??? maybe this can be very usefull for other people here but no with the ESC key...
Something like that doesn't deserve an interface to be honest.

If people want a different key then they can change the code

MSDN Virtual Keycodes
quote:
Originally posted by Matty
if (Interop.Call('user32', 'GetAsyncKeyState', 0x1b /* VK_ESC */) !== 0){

The 0x1b in this line would be changed to whatever Virtual Keycode you want from the link.

quote:
Originally posted by warmth
to have a timer like that always working doesn't cause memory leaks???

No

quote:
Originally posted by warmth
and there is a problem... when you have only a convo opened and the contact list and press ESC the convo get closed and the contact list too... cause it got the focus...
Happens to me too only once in awhile, not sure.

This post was edited on 04-20-2007 at 06:28 PM by matty.
04-19-2007 05:46 AM
Profile E-Mail PM Find Quote Report
warmth
Veteran Member
*****

Avatar
Electronic Engineer

Posts: 1730
Reputation: 26
39 / Male / Flag
Joined: Jul 2003
O.P. RE: [Request] Minimize to tray on focus contact window with a hotkey
mate, how about the other things I said??? you didn't answer any of those...

matty says in PM:

quote:
--------------------------------------------------------------------------------
On Today at 02:52 PM, warmth wrote:
mate can you aswer me what I asked u??? PLEASE...

--------------------------------------------------------------------------------

Fuck give me time jesus!

Why don't you figure it out for yourself?!?

This post was edited on 04-20-2007 at 06:28 PM by warmth.
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
04-19-2007 10:17 AM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Request] Minimize to tray on focus contact window with a hotkey
quote:
Originally posted by warmth
mate, how about the other things I said??? you didn't answer any of those...

matty says in PM:

quote:
--------------------------------------------------------------------------------
On Today at 02:52 PM, warmth wrote:
mate can you aswer me what I asked u??? PLEASE...

--------------------------------------------------------------------------------

Fuck give me time jesus!

Why don't you figure it out for yourself?!?
Ya well your impatient!
04-20-2007 06:31 PM
Profile E-Mail PM Find Quote Report
warmth
Veteran Member
*****

Avatar
Electronic Engineer

Posts: 1730
Reputation: 26
39 / Male / Flag
Joined: Jul 2003
O.P. RE: [Request] Minimize to tray on focus contact window with a hotkey
sorry for bring this old thread back but I think you matty (forget all problems we have) should add this script to DB adding some GUI and options... this maybe will be very useful for many people that don't know its existence...

name suggestion: CL2TRAY :$

UPDATE: the bug I told you about hitting ESC with only a convo opened is happening now everytime... seems like there is something wrong with the code indeed... :$

SUGGESTION: I don't know if this is possible but you should check if the write cursor at the worldwheel or in the search bar... cause sometimes you may wanna erase what you wrote there and the CL gets closed...

This post was edited on 09-05-2008 at 03:34 PM by warmth.
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
09-04-2008 08:26 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Request] Minimize to tray on focus contact window with a hotkey
I can see why it is happening however not sure the way it was programmed previously can fix it... try this solution...

code:
/*
    This is a simple script to detect when the user presses the
    escape key, the Messenger Contactlist will close.
   
    Coded by Matty
    Request from: http://shoutbox.menthix.net/showthread.php?tid=73662
*/


function OnEvent_Initialize(bMessengerStart){
    /* Create a timer to monitor the window and the keys pressed */
    MsgPlus.AddTimer('_minimize_window', 100);
}

function OnEvent_Timer(sTimerId){
    /* Check to see if the contactlist is the focused window */
    if (Interop.Call('user32', 'GetForegroundWindow') !== Messenger.ContactListWndHandle){
    MsgPlus.AddTimer('_minimize_window', 100);
    return false;
   } else {
        /* Check to see if we press the escape key */
        if (Interop.Call('user32', 'GetAsyncKeyState', 0x1b /* VK_ESC */) !== 0){
            /*
                Looks like we pressed the escape key, so lets close the window
                We send a WM_CLOSE to the window using the SendMessageW api
            */

            Interop.Call('user32', 'SendMessageW', Messenger.ContactListWndHandle, 0x10 /* WM_CLOSE */, 0, 0);
        }
    }
    /* Readd the timer no matter what so that we can keep monitoring the windows */
    MsgPlus.AddTimer('_minimize_window', 100);
}

This post was edited on 09-05-2008 at 03:52 PM by matty.
09-05-2008 03:51 PM
Profile E-Mail PM Find Quote Report
Pages: (4): « First [ 1 ] 2 3 4 » 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