Window docking

Windows Live Messenger

I have been asked a few times if it’s possible to dock the contact list window to the side of the screen - just like in ICQ. Then I read on the forums about an upcoming version of Messenger Plus! incorperating this feature, so I’ve decided to document some old source of mine which does this. I always of have my contact list on the right of the screen, so this article and the example work with docking it to the right.

Firstly, you’ll want to assign part of the screen for the Messenger window, do this by changing the work area size with SystemParametersInfo with the uiAction argument being SPI_SETWORKAREA. The new size should be same (get it with SPI_GETWORKAREA), except the width being minus the width of the Messenger window. By default, the work area is everywhere on screen except for the taskbar, basically the area in which a window is maximized in.

The next step is to move the Messenger window between the right end of the new work area, and the right end of the screen. Any maximized windows will be up against the left of the Messenger window, so it will always be visible. It would make sense to change the top of the window to 0, and the height to the height of the work area (which is left the same).

Source is included, it also re-maximizes any already maxized windows so they fit into the new work area. Be creative!

Download WindowDock.zip

1 Response to “Window docking”


  1. 1 anatolyg

    Great!

    I am not familiar with VB.
    How to implement the same with C MFC?

    Thanks,
    Anatoly

Leave a Reply