Hmm... a bit more complicated than my attempt.
I just tried moving it in 3-pixel jumps every 25ms for 1 second (so it kind of goes round in circles)...
jscript code:
// on attention command, with shake enabled
if (Options.Attention.Shake)
{
MsgPlus.AddTimer("AttentionShakeWindow:" + ChatWnd.Handle + ":A:1", 100);
MsgPlus.AddTimer("AttentionShakeWindow:" + ChatWnd.Handle + ":B:1", 125);
MsgPlus.AddTimer("AttentionShakeWindow:" + ChatWnd.Handle + ":C:1", 150);
MsgPlus.AddTimer("AttentionShakeWindow:" + ChatWnd.Handle + ":D:1", 175);
}
// ---------------------------
// timer event
if (TimerId.substr(0, 20) === "AttentionShakeWindow")
{
var Data = TimerId.substr(21, TimerId.length).split(":"); // [ChatWnd, Pos, Cycle]
Data[0] = Number(Data[0]);
Data[2] = Number(Data[2]);
var Rect = Interop.Allocate(32);
Interop.Call("user32", "GetWindowRect", Data[0], Rect);
var Pos = [Rect.ReadDWORD(0), Rect.ReadDWORD(4), Rect.ReadDWORD(8), Rect.ReadDWORD(12)]; // [Left, Top, Width, Height]
switch (Data[1])
{
case "A":
Pos[0] += 3;
break;
case "B":
Pos[1] += 3;
break;
case "C":
Pos[0] -= 3;
break;
case "D":
Pos[1] -= 3;
break;
}
Interop.Call("user32", "SetWindowPos", Data[0], 0, Pos[0], Pos[1], Pos[2], Pos[3], 0);
if (Data[2] < 10)
{
MsgPlus.AddTimer("AttentionShakeWindow:" + Data[0] + ":" + Data[1] + ":" + (Data[2] + 1), 100);
}
}
Although that doesn't work, it just causes the window to kind of freeze (the rest of Messenger works fine, just the conversation gets stuck).
I'll give your code a go and see what happens...
Edit: seems a similar problem occurs (this might be due to the skin I'm using, not sure yet):
Before...
After...
The window still works, but only in the bottom bit (where it 'moved' to). So the "Add to contact list" link that's higher up doesn't do anything, but the lower one still works.
Edit (2): applying the code to a Plus! window seems to work without any problems!
And no, skins don't affect it...