Hi :]
phalanxii: i'm not totally sure if it's correct, but it works fine here
code:
var GWL_WNDPROC = -4
var lpPrevWndProc = 0
function OnEvent_Initialize() {
if(Messenger.MyStatus > 0) OnEvent_SigninReady();
}
function OnEvent_SigninReady() {
for (var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext()) OnEvent_ChatWndCreated(e.item());
}
function OnEvent_Uninitialize(MessengerExit){
for (var e = new Enumerator(Messenger.CurrentChats); !e.atEnd(); e.moveNext()){
if (lpPrevWndProc != 0) Interop.Call('user32', 'SetWindowLongW', e.item().Handle, GWL_WNDPROC, lpPrevWndProc)
}
}
function OnEvent_ChatWndCreated(ChatWnd){
lpPrevWndProc = Interop.Call('user32', 'SetWindowLongW', ChatWnd.Handle, GWL_WNDPROC, Interop.GetCallbackPtr('WindowProc') )
}
function OnEvent_ChatWndDestroyed(ChatWnd){
if (lpPrevWndProc != 0) Interop.Call('user32', 'SetWindowLongW', ChatWnd.Handle, GWL_WNDPROC, lpPrevWndProc)
}
function WindowProc(hwnd, uMsg, wParam, lParam){
if (uMsg == 0x6 && wParam != 0){
// stuff
}
return Interop.Call('user32', 'CallWindowProcW', lpPrevWndProc, hwnd, uMsg, wParam, lParam)
}
* felipEx waits for Cookie's reply