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. RE: [Request] Minimize to tray on focus contact window with a hotkey
thanks matty but now convos doesn't close with ESC :(

This post was edited on 05-20-2009 at 02:25 AM by warmth.
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
05-20-2009 02:21 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
Ok I started coding a low level keyboard hook but it didn't quite work out in Plus! scripting.

I know that writing some ASM and internally subclassing the contact list window is the way to go but I have no idea how to do that...

* matty looks at Mnjul
05-20-2009 01:05 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
* warmth feels that this is gonna takes so much time :(
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
05-20-2009 05:00 PM
Profile PM Web Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: [Request] Minimize to tray on focus contact window with a hotkey
quote:
Originally posted by matty
Ok I started coding a low level keyboard hook but it didn't quite work out in Plus! scripting.

I know that writing some ASM and internally subclassing the contact list window is the way to go but I have no idea how to do that...

* matty looks at Mnjul
Blah, yeah, I know how, but I don't have time either :P You have to wait at least for another ten days, warmth.
05-20-2009 05:09 PM
Profile PM Web 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
* warmth starts counting :D 9 days 23 hrs 21 minutes left...

This post was edited on 05-20-2009 at 05:32 PM by warmth.
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
05-20-2009 05:32 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 was looking at your CTRL+W window closer but I can't seem to see at what point you define the key combination to close the window. Because that I could easily change to TRY and make it work.
05-20-2009 05:33 PM
Profile E-Mail PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: [Request] Minimize to tray on focus contact window with a hotkey
Oh that. I used spy++ to examined window messages and found out I could detect Ctrl+W with (perhaps only with, I don't remember) WM_TEXT (0x0102) message, with which Ctrl+W is 0x17 in wparam.
05-20-2009 05:38 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
js code:
function embedCode(hWnd){
    if(!subClassProcAddr){
        var hCurrentProcess = Interop.call("kernel32.dll", "GetCurrentProcess");
        subClassProcAddr = Interop.Call("kernel32.dll", "VirtualAlloc", null, CODE_SIZE, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE);
        var code = Interop.Allocate(CODE_SIZE);
        var pos = 0;
        code.SetAt(pos++, 0x55);                // push ebp
        code.SetAt(pos++, 0x8b);                // mov ebp, esp
        code.SetAt(pos++, 0xec);
        code.SetAt(pos++, 0x81);                // cmp dword ptr [ebp+12], WM_NCDESTROY
        code.SetAt(pos++, 0x7d);
        code.SetAt(pos++, 0x0c);
        code.SetAt(pos++, 0x82);
        code.SetAt(pos++, 0x00);
        code.SetAt(pos++, 0x00);
        code.SetAt(pos++, 0x00);
        code.SetAt(pos++, 0x74);                // je remove
        code.SetAt(pos++, 0x31);
        code.SetAt(pos++, 0x81);                // cmp dword ptr [ebp+12], WM_CHAR
        code.SetAt(pos++, 0x7d);
        code.SetAt(pos++, 0x0c);
        code.SetAt(pos++, 0x02);
        code.SetAt(pos++, 0x01);
        code.SetAt(pos++, 0x00);
        code.SetAt(pos++, 0x00);
        code.SetAt(pos++, 0x75);                // jne exit
        code.SetAt(pos++, 0x3a);
        code.SetAt(pos++, 0x83);                // cmp dword ptr [ebp+16], 23
        code.SetAt(pos++, 0x7d);
        code.SetAt(pos++, 0x10);
>>>        code.SetAt(pos++, 0x17);                /* Maybe 0x1B for the Escape key? */<<<
        code.SetAt(pos++, 0x75);                // jne exit
        code.SetAt(pos++, 0x34);
        code.SetAt(pos++, 0x6a);                    // push 0
        code.SetAt(pos++, 0x00);
        code.SetAt(pos++, 0x6a);                    // push 0
        code.SetAt(pos++, 0x00);
        code.SetAt(pos++, 0x6a);                    // push WM_CLOSE
        code.SetAt(pos++, 0x10);
        code.SetAt(pos++, 0xff);                    // push [ebp+8]
        code.SetAt(pos++, 0x75);
        code.SetAt(pos++, 0x08);
        code.SetAt(pos++, 0xb9);                    // mov ecx, &GetParent
        code.WriteDWORD(pos, getLibraryProcAddress("user32.dll", "GetParent"));
        pos += 4;
        code.SetAt(pos++, 0xff);                    // call ecx
        code.SetAt(pos++, 0xd1);
        if(Messenger.Version >= 9){
            code.SetAt(pos++, 0x50);                // push eax
            code.SetAt(pos++, 0xb9);                // mov ecx, &GetParent
            code.WriteDWORD(pos, getLibraryProcAddress("user32.dll", "GetParent"));
            pos += 4;
            code.SetAt(pos++, 0xff);                // call ecx
            code.SetAt(pos++, 0xd1);
        }else if(Messenger.Version >= 8){
            code.WriteDWORD(pos, 0x00841f0f);        // nop dword ptr [eax + eax*1 + 00000000h]
            pos += 4;
            code.WriteDWORD(pos, 0x00000000);
            pos += 4;
        }       
        code.SetAt(pos++, 0x50);                    // push eax
        code.SetAt(pos++, 0xb9);                    // mov ecx, &PostMessageW
        code.WriteDWORD(pos, getLibraryProcAddress("user32.dll", "PostMessageW"));
        pos += 4;
        code.SetAt(pos++, 0xff);                    // call ecx
        code.SetAt(pos++, 0xd1);
        code.SetAt(pos++, 0xeb);                    // jmp exit
        code.SetAt(pos++, 0x12);
                                                // remove:
        code.SetAt(pos++, 0xff);                // push [ebp+24]
        code.SetAt(pos++, 0x75);
        code.SetAt(pos++, 0x18);
        code.SetAt(pos++, 0x68);                // push &subClassProcAddr
        code.WriteDWORD(pos, subClassProcAddr);
        pos += 4;
        code.SetAt(pos++, 0xff);                // push [ebp+8]
        code.SetAt(pos++, 0x75);
        code.SetAt(pos++, 0x08);
        code.SetAt(pos++, 0xb9);                // mov ecx, &RemoveWindowSubclass
        code.WriteDWORD(pos, getLibraryProcAddress("comctl32.dll", "RemoveWindowSubclass"));
        pos += 4;
        code.SetAt(pos++, 0xff);                    // call ecx
        code.SetAt(pos++, 0xd1);
                                                // exit:
        code.SetAt(pos++, 0xff);                // push [ebp+20]
        code.SetAt(pos++, 0x75);
        code.SetAt(pos++, 0x14);
        code.SetAt(pos++, 0xff);                // push [ebp+16]
        code.SetAt(pos++, 0x75);
        code.SetAt(pos++, 0x10);
        code.SetAt(pos++, 0xff);                // push [ebp+12]
        code.SetAt(pos++, 0x75);
        code.SetAt(pos++, 0x0c);
        code.SetAt(pos++, 0xff);                // push [ebp+8]
        code.SetAt(pos++, 0x75);
        code.SetAt(pos++, 0x08);
        code.SetAt(pos++, 0xb9);                // mov, ecx, &DefSubclassProc
        code.WriteDWORD(pos, getLibraryProcAddress("comctl32.dll", "DefSubclassProc"));
        pos += 4;
        code.SetAt(pos++, 0xff);                // call ecx
        code.SetAt(pos++, 0xd1);
        code.SetAt(pos++, 0xc9);                // leave
        code.SetAt(pos++, 0xc2);                // retn 24
        code.SetAt(pos++, 0x18);
        code.SetAt(pos++, 0x00);
       
        ASSERT(pos == CODE_SIZE, "Code insertion complete");
       
        Interop.Call("kernel32.dll", "WriteProcessMemory", hCurrentProcess, subClassProcAddr, code.DataPtr, CODE_SIZE, null);
    }
    if(subClassProcAddr){
        Interop.Call("comctl32.dll", "SetWindowSubclass", hWnd, subClassProcAddr, 0, 0);
    }
}

This post was edited on 05-20-2009 at 06:10 PM by matty.
05-20-2009 06:05 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
Well guys :P let me know when I can test it ;)... thanks for your effort!

This post was edited on 05-20-2009 at 08:14 PM by warmth.
@warmth - Beta Testing a life!
Official Nokia (former Ovi) Suite Beta Tester | Nokia Beta Labs Contributor of the month (June, 2011)
05-20-2009 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
Here you go.

Based off of the Ctrl+W script by Mnjul.

All credit goes to him!

.plsc File Attachment: ESC Closer.plsc (2.92 KB)
This file has been downloaded 149 time(s).

This post was edited on 05-20-2009 at 09:23 PM by matty.
05-20-2009 09:22 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