Okay, so I was working on my top secret script project (*evil laugh*), but then I stumbled onto something VERY weird... Here's the situation.
I've got a parent window, the Preferences window. It contains some bottom bar buttons and links to the various preferences child windows. When the user clicks a such link, the associated child window becomes visible while the others are hidden. Using a simple piece of code, the child windows get resized along with the parent when the parent is resizing:
code:
function OnWndPrefEvent_MessageNotification(PlusWnd, Message, wParam, lParam) {
if(Message == /* WM_SIZE */ 0x5) {
//MSDN told me that the width and height are in the lParam, so let's make use of it
var wWidth = lParam & 0xFFFF; //Get low-order word
var wHeight = (lParam >> 16); //Get high-order word
//Now, we need to crop the area for the child windows
cWidth = wWidth - 15;
cHeight = wHeight - 117;
//Finally, resize the child windows
Interop.Call("User32", "SetWindowPos", Wnd["WndPrefGeneral"].Handle, 0, 0, 0, cWidth, cHeight, 18);
Interop.Call("User32", "SetWindowPos", Wnd["WndPrefLanguage"].Handle, 0, 0, 0, cWidth, cHeight, 18);
}
//Let the window do its stuff too (don't know what, but who cares)
return -1;
}
(The values I subtract from the size are found out by trying out, changing and re-try. No special maths were used for it.)
The above code worked flawless, everything resized perfectly... except one thing I found out today.
While I was working on the Languages child window, I found out that a specific combination of a ListViewControl with LargeIconView and a LinkControl with a BottomFixed Anchor attribute can cause a glitch, making the LinkControl return to the original position, before the window got resized. A quick compiled image should clarify this:
As you can see, the LinkControl jumps to it's original position. When I try to resize the window vertically then, the control moves from that position. So, if I resize the parent 10 pixels upwards, the control moves 10 pixels upwards, meaning that it actually took a new position.
If you want to reproduce this, create a window, create a child window with a ListViewControl with LargeIconView and a LinkControl with BottomFixed. Make the parent resizable and use the above code for the child window resizing. Add 2 items to the ListViewControl and follow the instructions.
Now, I'd like to know: can this glitch be fixed with a piece of code or is it caused by Plus! itself? Or is there any other reason which might cause this happening?
Specifications:
Windows Vista Ultimate x64
Windows Live Messenger 8.1.0178 (skinned with Windows Aero Messenger)
Messenger Plus! Live 4.23.0.276