What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Skinning » [How To] - Hide Elements, Forced Hiding and Options

[How To] - Hide Elements, Forced Hiding and Options
Author: Message:
aNILEator
Skinning Contest Winner
*****

Avatar
...in the wake of the aNILEator

Posts: 3718
Reputation: 90
35 / Male / Flag
Joined: Oct 2003
Status: Away
O.P. [How To] - Hide Elements, Forced Hiding and Options
In this tutorial I'll show you how to hide elements from messenger.

In this example You will learn how to hide the search bar from the contact list.

There are 2 ways of hiding elements Forced Hiding and Using *PlusSkin* Options This tutorial covers both methods and provides additional information.

Although this tutorial will only show how to hide the search bar element the same methods can be used to hide most elements.

NOTE: Skins WILL NOT BE ACCEPTED on the forum or Official Skins Database if they force hide advertisements or have a visible option to hide the adverts from messenger

On to the Tutorial!

Creating a new Skin

• Firstly extract the resources of your current messenger version, this can be done via Messenger Plus' own Skinning section within it's preferences. Navigate to Customize->Skinning and Press 'Extract Resources' from the Skin Developers Bar. This will present the extraction options window, extract to your chosen folder.

Hint: Selecting Consolidate Windows will arrange all the extracted resources into a more understandable/organised way

• Create a new folder in the Messenger Plus! Live Skins directory (usually "C:\Program Files\Messenger Plus! Live\Skins\") This will be where you place all the files related to your new skin. For now create a new folder with a name for your skin (eg. My Skin, Hide The Search Bar etc)

• Create a new file and call it SkinInfo.xml this is the where you will define everything your skin needs to replace, add or refer to later on.

• Edit SkinInfo.xml to have a header like so

code:
<SkinInfo>
    <Information>
         <Name>Hide The Search Bar</Name>
        <Version>1.00</Version>
        <Description>A Skin to hide the Search Bar in Messenger</Description>
        <AboutUrl>http://www.msgpluslive.com</AboutUrl>
        <Screenshot>
            <File>screenshot.png</File>
        </Screenshot>
        <Compatibility>
            <MsgVersion Major="8" Minor="0"/>
            <MsgVersion Major="8" Minor="1"/>
            <MsgVersion Major="8" Minor="5"/>
            <MsgVersion Major="9" Minor="0"/>
        </Compatibility>
    </Information>


NOTE: The Compatibility section restricts what version of Messenger your skin will load on, so you can make a skin only for WLM8.5 if you want too, and not allow support and compatibility with WLM8.1, in the long run this helps avoid any issues your skin might pose to other versions of Messenger people may be using.

If you do not know what version of Messenger you have, you can find out by opening Messenger and on the Menu Bar (File, Contacts, Actions etc) Go to Help->About Messenger a window will be displayed that shows the version that you are running. Eg Version 8.1.0178 would translate to <MsgVersion Major="8" Minor="1"/>



Starting to Skin

You need to tell SkinInfo.xml what to replace so after </Information>  you will need code similar to the example below
code:
    <MessengerSkin>
        <ResGroup>
            <Restrictions>
                <MsgVersions>
                    <Version Major="8" Minor="5"/>
                    <Version Major="9" Minor="0"/>
                </MsgVersions>
            </Restrictions>


Everything inside the
<MessengerSkin> tag is part of what will be skinned
<ResGroup> can be used to separate sections, for instance a resgroup for replacing items only in 8.0 and another for 8.1 and so on.
<Restrictions> This can be used to restrict a Resgroup to only alter WLM 8.0 and 8.5, or only 8.5 etc (Essential for compatibility between different WLM Versions)

This tells the Group what to do basically.



Replacing Resources

After Restrictions Add <Resources><Replace>
code:
    <MessengerSkin>
        <ResGroup>
            <Restrictions>
                <MsgVersions>
                    <Version Major="8" Minor="5"/>
                </MsgVersions>
            </Restrictions>
            <Resources>
            <Replace>
Everything inside <Replace> gets (Guess what! ;)) Replaced :D

So you'll want to add a code like this

code:
<Resources>
            <Replace>
                <Windows>
                        <Definitions>
                            <Definition Id="923"><File>923 Definition.txt</File></Definition>
                        </Definitions>                   
                </Windows>
            </Replace>
    </Resources>

This is telling plus to replace the Window Definitions of Messenger with modified ones (there are other tags such as <styles> and <strings> but these are not needed for these modifications).

923 is the Contact List Window which we will be editing later on.

Copy this definition from your earlier extracted resources into your skin directory, if you haven't already, as now it's time to get editing! (H)

HINT: If you plan on creating a skin that modifies lots of files, you may want to organize them into folders, or copy over the whole contents of the Consolidated Windows Folder to your skin's directory, this may help you to keep things organized.



Editing Definitions - Forced Hiding

• Open up your skin directory's copy of 923 Definition.txt in the editor of your choice.

• Press "Ctrl+F" to bring up the search box, search for idSearchContainer It should bring you to some lines that say:
code:
<Element layoutpos=bottom padding=rect(8,0,8,8) layout=filllayout() ID=Atom(ai217)>
<element id=atom(idSearchContainer) layout=filllayout() padding=rect(4,0,4,4)>


Notice that in the line above there is a "layoutpos=bottom" specified, to hide the Search Bar you want to edit this attribute.

• To force hide the Search Bar change "layoutpos=bottom" to "layoutpos=none"
This will hide the Search Bar from the contact list.

This method is the same for most Elements you may want to force hide.
If an element that you want to hide does not have a layoutpos to modify, you can add one, it may work depending on the element. Give it a go :)

So..

Save all files, apply the skin via Plus' Preferences and restart messenger the Search Bar Element should now be gone :D

HINT: Sometimes Element ID's change between messenger versions, so it's best to check before you edit anything, that you are editing the correct line.



*PlusSkin* Options Hiding

I highly recommend that you use this feature instead of force modifying anything!

Using Plus' Advanced Options you can let users decide what features they want or don't want in their messenger.

The options are enabled via the registry so a .reg file could be included with your skin to activate any options that you are otherwise not allowed to display in the options window for your skin ;)

Putting <!--Comments Tags--> around an option will also not allow it load in your skins Options Window
Unless the tags are removed or the option is enabled via the registry.

The <!-- defines the beginning of a commented section the --> defines it's end, items between will not be loaded.

Comment Tags can also be used for organization purposes, so you can easily distinguish a particular code segment's purpose or for disabling a particular piece of code that you perhaps are still working on and do not want loaded at the moment.

So, on with the show...

Adding Options to the Options Window

Messenger Plus will automatically generate an options box when you define your options in SkinInfo.xml so here's how to add options.

• Open up SkinInfo.xml and between </Information> and <MessengerSkin> add the following
code:
    </Information>
    <Options>
        <Skin>
            <Properties>
                <BoolVal Name="RemSearchBar"><DispLabel>Remove The Seach Bar (Contact list)</DispLabel><Default>false</Default></BoolVal>
            </Properties>
         </Skin>
    </Options>
    <MessengerSkin>

This will then generate a check box option that will enable/disable the registry setting for RemSearchBar

As I'm sure you'll notice, there are attributes in use
One defines the "Name" of the option, this will be what registry item is affected by the check box state.
The other is the description that is displayed alongside the check box in the Options Window.

So now we've told Plus what to modify in registry, we need to actually create the code for RemSearchBar to work

Editing Definitions for *PlusSkin* Options

• Open up your skin directory's copy of 923 Definition.txt in the editor of your choice.

• Press "Ctrl+F" to bring up the search box, search for idSearchContainer It should bring you to some lines that say:
code:
<Element layoutpos=bottom padding=rect(8,0,8,8) layout=filllayout() ID=Atom(ai217)>
<element id=atom(idSearchContainer) layout=filllayout() padding=rect(4,0,4,4)>


• To add a *PlusSkin* option to allow you to hide the Search Bar change "layoutpos=bottom" to "<*PlusSkin Conditions(RemSearchBar = false)*>layoutpos=bottom</*PlusSkin*> <*PlusSkin Conditions(RemSearchBar = true)*>layoutpos=none</*PlusSkin*>"

Here we've defined a true and false statement for the *PlusSkin* option to follow.

If the option is turned off (false) then layoutpos=bottom.
If the option is turned on (true) then layoutpos=none

So this will hide the Search Bar if the option is true, if not it will leave it alone.

RemSearchBar is the name I decided to give this option, notice it matches the same in the SkinInfo.xml, this is so the option in SkinInfo.xml affects the code we just written.

HINT: You can alter several elements with one option just use the same "Name" this could be useful for having an option to centre align all toolbars at once, or hide multiple elements all at once ;)

This method is the same for most Elements you may want to hide with the *PlusSkin* command.

And now you're done Editing the Definitions!!!

NOTE: If you did not <!-- comment out --> the options in SkinInfo.xml then Plus will automatically generate an options window that can be accessed by the preferences->Customize->Skins "Skin Options" button.
Or the plus button on the contact list->Messenger Skin->Skin's Options



Creating a HideElement.reg

So You've decided to release your skin publicly via these Forums or the Skins Database, GREAT! Your skin has the potential to be used by Millions of Messenger Plus Users! :D

But you want users to be able to hide certain elements that you're restricted on adding an option for have no fear, I can help you do this one too!

We're going to to create a HideElement.reg file

• In the Skin Directory create a new file call it HideElement.reg

• Right Click the file and choose 'Edit' it should open in notepad

• Add this code to the file.

code:
; Purpose: Enables a PlusSkin option via the registry.
; Created by aNILEator, 2007-12-06

[HKEY_CURRENT_USER\Software\Patchou\Messenger Plus! Live\GlobalSettings\Skins\Hide The Search Bar\Settings]
"RemSearchBar"=dword:00000001

Where Hide The Search Bar is the name of your skin as you set in SkinInfo.xml

• Save and exit

• Now if you run/merge HideElement.reg it should enable the RemSearchBar functions you defined as a *PlusSkin* option

HINT: You can define more values to be adjust by creating a new line for each item, like so

code:
[HKEY_CURRENT_USER\Software\Patchou\Messenger Plus! Live\GlobalSettings\Skins\Hide The Search Bar\Settings]
"RemSearchBar"=dword:00000001
"RemOtherItem"=dword:00000001
"RemAnotherItem"=dword:00000001

Now you can zip up the contents of your skin directory
Rename it from SkinNameHere.zip to SkinNameHere.plsk and submit it to the Skins Database or upload here on the forums!

And that's the end of this [How To] you should have learnt a lot in an easy to follow format (That's what I hope anyway)

If this has been of particular help to you please take the time to thank me below for taking over 6 hours to type it out (and another 3 hours+ editing it all over again :dodgy:) all for free (8-) I'm crazy)

And/Or please leave a reputation point for me please by clicking the star.

Thank You

Nile

[Image: star.gif]
Rate Me.

This Tutorial May Not Be Copied Without My Permission, Please Contact me for permission :)
12-06-2007 09:04 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 12-06-2007 at 09:04 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by riahc4 on 12-16-2007 at 10:21 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by prashker on 12-16-2007 at 10:23 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by riahc4 on 12-17-2007 at 12:08 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 12-17-2007 at 12:18 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by stuartbennett on 12-18-2007 at 08:49 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by piper on 12-19-2007 at 10:37 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 12-20-2007 at 12:05 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by stuartbennett on 12-20-2007 at 01:37 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by djdannyp on 12-21-2007 at 02:09 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 12-21-2007 at 09:12 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by djdannyp on 12-21-2007 at 10:28 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by Toneo on 12-27-2007 at 07:58 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by CookieRevised on 12-27-2007 at 10:37 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by stuartbennett on 12-28-2007 at 08:28 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 12-28-2007 at 10:38 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by stuartbennett on 12-29-2007 at 08:43 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 12-29-2007 at 09:36 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by stuartbennett on 12-29-2007 at 10:25 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by Basilis on 01-03-2008 at 10:48 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 01-03-2008 at 09:03 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by LuckyMe on 02-21-2008 at 06:51 AM
RE: [How To] - Hide Elements, Forced Hiding and Options - by TheSourcE on 04-18-2008 at 03:31 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 04-18-2008 at 03:59 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by djdannyp on 04-18-2008 at 05:03 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by aNILEator on 04-18-2008 at 09:03 PM
RE: [How To] - Hide Elements, Forced Hiding and Options - by TheSourcE on 04-19-2008 at 09:38 AM


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