I think the problem with the tabbed chats is because
/^.+\s-\s.+\r\n\((\d+)\s.+\)$/i.test(OwnerTitle) returns
false, even with tabbed chats, meaning my debug window reads:
quote:
HasTabs = false
I fixed this by changing the expression to
(OwnerTitle.substr(OwnerTitle.length - 14) == " tabbed chats)"), and now it works perfectly!
The code that works for me:
code:
function OnEvent_Timer (TimerId) {
...
if (S.FixTabs){
var OwnerWindow = Interop.Call("User32.dll", "GetWindow", ChatWnd.Handle, 4)
if (OwnerWindow != 0) {
if (dbg) Debug.Trace("Chat hWnd:" + ChatWnd.Handle + " has Owner hWnd:" + OwnerWindow)
var aTitle = Interop.Allocate(640)
Interop.Call("User32.dll", "GetWindowTextW", OwnerWindow, aTitle, 640)
var OwnerTitle = aTitle.ReadString(0)
if (dbg) Debug.Trace("\tTitle = " + OwnerTitle)
if (dbg) Debug.Trace("\tHasTabs = " + (OwnerTitle.substr(OwnerTitle.length - 14) == " tabbed chats)"))
if (OwnerTitle.substr(OwnerTitle.length - 14) == " tabbed chats)") {
var PosTop = (Shell.RegRead("HKCU\\Software\\Patchou\\Messenger Plus! Live\\" + Messenger.MyEmail + "\\Preferences\\TabChatPosition") * 1 == 0)
if (dbg) Debug.Trace((PosTop) ? "\tPosition = Top" : "\tPosition = Left")
if (PosTop) {
if (S.Top) _y += 28
} else {
if (S.Left) _x += Shell.RegRead("HKCU\\Software\\Patchou\\Messenger Plus! Live\\" + Messenger.MyEmail + "\\Preferences\\TabChatMinSize") * 1
}
}
}
...
}
I hope you don't mind me editing the script.