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

[Request] Minimize to tray on focus contact window with a hotkey
Author: Message:
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
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Request] Minimize to tray on focus contact window with a hotkey - by warmth on 04-16-2007 at 10:41 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 04-17-2007 at 05:54 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 04-18-2007 at 03:10 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 04-18-2007 at 06:38 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 04-18-2007 at 08:14 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 04-19-2007 at 05:46 AM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 04-19-2007 at 10:17 AM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 04-20-2007 at 06:31 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 09-04-2008 at 08:26 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 09-05-2008 at 03:51 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 09-05-2008 at 04:23 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 01-13-2009 at 01:43 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 01-13-2009 at 02:11 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 01-13-2009 at 02:15 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 01-13-2009 at 03:38 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 01-13-2009 at 04:54 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 01-27-2009 at 12:10 AM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-14-2009 at 02:50 AM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-19-2009 at 02:22 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 05-19-2009 at 03:25 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-20-2009 at 02:21 AM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 05-20-2009 at 01:05 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-20-2009 at 05:00 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by Mnjul on 05-20-2009 at 05:09 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-20-2009 at 05:32 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 05-20-2009 at 05:33 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by Mnjul on 05-20-2009 at 05:38 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 05-20-2009 at 06:05 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-20-2009 at 08:14 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 05-20-2009 at 09:22 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-20-2009 at 11:32 PM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by matty on 05-21-2009 at 01:21 AM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 05-21-2009 at 03:03 AM
RE: [Request] Minimize to tray on focus contact window with a hotkey - by warmth on 11-14-2009 at 03:48 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