What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Weirdness. Evolved.

[?] Weirdness. Evolved.
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
O.P. Huh?  [?] Weirdness. Evolved.
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:
[Image: attachment.php?pid=840560]
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

.png File Attachment: script_prob_001.png (69.17 KB)
This file has been downloaded 326 time(s).
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-02-2007 07:05 PM
Profile E-Mail PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
O.P. RE: [?] Weirdness. Evolved.
Update:
This only happens if you change the text of the LinkControl when the ListViewControl's selection changes (using OnWndIdEvent_LstViewSelStateChanged). However, I still wonder why this happens...

I can't seem to set the position of the LinkControl using SetWindowPos neither... probably because it's anchored, but then how can I fix this? I need some help here! :(

I can now confirm that when PlusWnd.SetControlText() is called, the position is restored. When I added Wnd["WndPrefLanguage"].SetControlText("LnkWebsite", "http://") to the resize event, I could clearly see how it always jumps to the start position while the window resizes. So, OR it's the way my event is built, OR it's SetControlText causing this.

This post was edited on 08-04-2007 at 12:31 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-04-2007 11:34 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Weirdness. Evolved.
Sounds like a bug in your anchoring in your xml file.

Try using this
code:
<Anchor Vertical="TopBottomFixed" />


code:
<Anchor Vertical="BottomFixed" />

It isn't documented but i think it works...
Confirmed, it works

This post was edited on 08-04-2007 at 01:16 PM by matty.
08-04-2007 01:03 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
O.P. RE: [?] Weirdness. Evolved.
^o)

I don't think you get it... I want it to be bottom fixed (so I set <Anchor Vertical="BottomFixed">), but it jumps back to the original position when the ListViewControl's selection changes. This is because I call PlusWnd.SetControlText on the LinkControl in that event, but I don't know why it's doing this.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-04-2007 01:13 PM
Profile E-Mail PM Web Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: [?] Weirdness. Evolved.
i don't see any difference between screenshot 2 and 3...
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
08-04-2007 01:28 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
O.P. RE: [?] Weirdness. Evolved.
quote:
Originally posted by ShawnZ
i don't see any difference between screenshot 2 and 3...
The link moved...
* Matti gives ShawnZ some trendy glasses. 8-|
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-04-2007 01:41 PM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Weirdness. Evolved.
I did some testing when you change the text of a LinkControl when it has an Anchor the control moves to its original position.

Does this with SetControlText, WM_SETTEXT, SetWindowTextW.
08-04-2007 02:21 PM
Profile E-Mail PM Find Quote Report
« 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