Auto Hide control

Auto Hide control

This article was submitted .

This is an Auto Hide control. I named it Auto Hide because this is the title of the control's window class in the VisualStudio.NET Beta 1 editor.
It sports a panel located on the left side of your application frame. When you click or hover above one of the text items, a new view window will slide out and allow you to click around. When the view window looses focus, it slides back.

I'm not really sure how useful a control like this is in a real application (erh, other than and IDE). It seems pretty annoying and there's no way of getting rid of that blasted sliding window effect. Well, use it if you like it...

To add the Auto Hide control to your frame window, add this...

   CAutoHide m_autohide;
Create the control window after the MDI client has been created and set, like this:
   LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM ...

      m_hWndClient = m_autohide.Create(m_hWnd, rcDefault);
Then create the views and add them to the control using the AddWindow() method.
      m_view1.Create(m_hWndClient, rcDefault, _T("View1"), 

The Auto Hide panel, which hosts the views is currently a bit of a hack. It's a regular window with a resizing frame, but all edges except the one on the right are disabled and rendered grey.

The slide animation looks crap I think. Must be something to do with the ::AnimateWindow() method.

Source Code Dependencies

Microsoft WTL 3.0 Library

See Also

Sample WTL application

Download Files

DownloadSource Code (12 Kb)

To the top