Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Glass-Control

Glass-Control

Scheduled Pinned Locked Moved Windows API
c++comquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jurgen Jung
    wrote on last edited by
    #1

    Is it possible to give glass to ONE single control (toolbar,...) of a dialog-based application, which is otherwise "normal" ?? I am using WTL and ATL with VC 2005. Maybe this glass-control can be separated into an activex-control.

    A 1 Reply Last reply
    0
    • J Jurgen Jung

      Is it possible to give glass to ONE single control (toolbar,...) of a dialog-based application, which is otherwise "normal" ?? I am using WTL and ATL with VC 2005. Maybe this glass-control can be separated into an activex-control.

      A Offline
      A Offline
      Alain Rist
      wrote on last edited by
      #2

      Hi Jurgen, You can get that with the toolset I provided here[^] cheers, AR

      J 1 Reply Last reply
      0
      • A Alain Rist

        Hi Jurgen, You can get that with the toolset I provided here[^] cheers, AR

        J Offline
        J Offline
        Jurgen Jung
        wrote on last edited by
        #3

        Thank you very much for your answer. I have already seen you article and thats the reason i think it MUST work, somehow. But i don't see how to create a glass-toolbar in a dialog-based application. In your extension the function CreateAeroToolBarCtrl() is only available for WTL::CFrameWindowImpl. Maybe i miss a thing, but i can't see. Hoping for a (positive) response. :rose: :) :rose: JJ

        A 1 Reply Last reply
        0
        • J Jurgen Jung

          Thank you very much for your answer. I have already seen you article and thats the reason i think it MUST work, somehow. But i don't see how to create a glass-toolbar in a dialog-based application. In your extension the function CreateAeroToolBarCtrl() is only available for WTL::CFrameWindowImpl. Maybe i miss a thing, but i can't see. Hoping for a (positive) response. :rose: :) :rose: JJ

          A Offline
          A Offline
          Alain Rist
          wrote on last edited by
          #4

          Hi Jürgen,

          Jürgen Jung wrote:

          But i don't see how to create a glass-toolbar in a dialog-based application. In your extension the function CreateAeroToolBarCtrl() is only available for WTL::CFrameWindowImpl. Maybe i miss a thing, but i can't see.

          - Derive your dialog from aero::CDialogImpl and chain the message map as shown in the article. - Declare in your dialog class a aero:CToolbarCtrl variable, say m_ATB. - In your OnInitDialog() handler:    + with m_ATB create the toolbar control if it is not part of the DIALOGTEMPLATE resource, or subclass it.    + SetOpaque() the dialog client area except the toolbar rectangle. That should be enough to get what you want:) For instance, with any of the article's sample CAboutDlg, remove the IDC_STATIC group box to get some room and in aboutdlg.h:

          // aboutdlg.h : interface of the CAboutDlg class
          // ...
          class CAboutDlg : public aero::CDialogImpl<CAboutDlg>
          {
          public:
          enum { IDD = IDD_ABOUTBOX };
          aero::CToolBarCtrl m_ATB; // added
          // ...
          LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
          {
          CenterWindow(GetParent());
          // create the toolbar and aero enable it
          CToolBarCtrl tb = AtlCreateSimpleToolBar(m_hWnd, IDR_MAINFRAME);
          aero::Subclass(m_ATB, tb);
          // compute the opaque rectangle
          RECT rClient, rTB;
          GetClientRect(&rClient);
          m_ATB.GetWindowRect(&rTB);
          rClient.top += rTB.bottom - rTB.top;
          // Set the opaque area
          SetOpaque(rClient);

          return FALSE;
          

          }

          If you need to follow-up on this thread, better do it in the article forum. cheers, AR

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups