Feature-installation style tree control in C++ with MFC - c++

With reference to this installer control:
My question is: is this dropdown-button style tree control available to use for other purposes within an MFC application?
My suspicion (after inspecting with Spy++) is that it is a heavily customised SysTreeView32, using wide icons that look like buttons, and that mouse-clicks on these icons are intercepted to display dropdown menus.
Does anyone know any better?

Related

Changing the icon of a button in ribbbon

I have a ribbon application that designed based on Extensible Application Markup Language (XAML) in c++. I want to change the icon of one button when i click on it.
How can i change the icon?
My application is not MFC, I use Windows API.
You can't change the icon of a button when clicking, at least not in a regular way. The API doesn't support this, I guess for the reason that the UI Ribbon UI concept doesn't intend such a behavior (and you may want to think twice, before breaking an "intended behavior").
Anyway, you could force such a behavior by loading a resource file that refers to the very same XML definition (XML by the way, NOT XAML - we are not in the WPF world here), with the only exception being the source path of the regarding icon referring to something different.
The relevant API call for this is called IUIFramework::LoadUI.

Using ListControl in a Dialog window

Can ListControl be used in a dialog in a Non-MFC project? I am using visual c++ 2010.
The examples I have seen so far uses MFC, so it seems to me that ListControl is part of MFC. The code I am working on is not MFC based, however, Visual Studio still allows adding a ListControl to the dialog in the resource view, and generates rc code for the List Control. So my guess is that I should be able to use it. However, I could not use the standard method found online to add variable to the ListControl and use it.
How can I use the ListControl in this case? e.g. adding a column or write something to a cell? Some code example will certainly help.
The CListCtrl class is an MFC class. It can only be used from within an MFC project.
However, CListCtrl is simply a wrapper around the ListView common control, and a ListView control can be used in any Windows application—no MFC required.
The Resource Editor included with Visual C++ (confusingly) refers to a ListView control as a "List Control". You can insert one on your dialog, and all it will do is insert a ListView control.
If you're using MFC, you can choose to create a member variable corresponding to that control. The type of that member variable will be CListCtrl, because it is encapsulating access to a ListView control on your dialog.
If you are not using MFC, you can still use the ListView control, you'll just have to use the standard SDK mechanisms for accessing and manipulating it. For example, to insert an item into the ListView control on your dialog, you would obtain the control's window handle (GetDlgCtrlID) and send it a LVM_INSERTITEM message. The SDK documentation contains sample code listings, but they are a rather poor way to learn. The best resource for good old Windows SDK programming is still Charles Petzold's Programming Windows.

How to use MFC ListCtrl in SDI

I am really a beginner with MFC. I just want a few guidelines on how to use a ListCtrl in an SDI application. For example, getting input from the user and displaying it in the listctrl when a button is clicked. Please guide me.
In SDI application I would use CListView-derived class for main view. This class has been designed to be used in SDI/MDI apps and supports standard MFC document-view architecture. The CListView class internally uses CListCtrl, but it does automatic resizing and other handy things, you can also get direct access to embedded list ctrl by calling CListView::GetListCtrl() method that returns CListCtrl*.

Skin a dialog box

I am writing a C++ application and I have a Login Box that's shown in a regular Dialog Box Frame. I see that some people can SKIN the entire dialog box and makes it look really nice. I was wondering if anyone can give me some pointers as to how to do that.
I'd need more details to give you a good answer.
The answer very much depends on which OS you're using and how you're programming your GUI (for example on Windows - plain Win32, MFC, ATL, Qt, Windows Forms, WPF etc etc).
If you're just using the Windows API here's a link to get you started.
http://www.codeproject.com/KB/dialog/skinstyle.aspx
Beware: custom skinning dialog boxes can be a very large task if you want to customise the look of every control as you end up writing very complicated custom controls.
Alternatively do you just want to make sure that your dialogs appear with Windows XP visual style rather than pre-XP style? This will require changes to your application to use the new common controls and visual style. Note that this changes the behaviour of some Windows APIs and can potentially have side effects (see ISOLATION_AWARE_ENABLED).

Is it possible to change the location of the main top-level menu in an MFC MDI app?

I have an app with a customized frame (i.e., caption/titlebar, borders). I customized the frame by removing the WS_CAPTION style, and overriding OnNcCalcSize to reserve a custom-sized area for the caption, which the app paints in OnNcPaint.
A side effect is that the menu bar no longer displays, which is OK because I want to customize the appearance & location of the main menu. Unfortunately, I don't know how to do that. I would like the "File" menu to be further from the left edge than it is with the standard menu bar.
An acceptable alternative would be to remove the menu entirely, and use OnNcHitTest, OnNcPaint and OnNcMouseMove to manage a hand-coded replacement for the top-level menu.
I've never seen a way to modify the looks of the standard menu. You can remove it (remove the creation code from your InitInstance) and then code a replacement. I wouldn't do that in OnNcXXX though, rather make a new custom control that you position at the top. Or you could have a look at the MFC Next themed menus and write a custom UI renderer. It may be enough to override a few functions left and ride to set the alignment of the menu.
It's an MFC MDI app -- InitInstance is not where the menu is being created. I have tried to get rid of the menu (and succeeded, temporarily) but the MFC framework seems to be "putting it back" -- I think the MDI model has the child windows modify the menu, but the code that does that seems to be buried in the framework somewhere (or else I just haven't been able to find exactly where it happens in the application's code, but I suspect it's happening inside the MFC framework code). If I knew where, I might be able to override the methods(s) and take control... I think.
What would be the reason to write a custom control vs. handling OnNcMouseMove & OnNcLeftButtonDown, e.g.? I don't expect to need the functionality in any other app (a new app would be coded in C#, probably), so I'm looking for ease of implementation, not code reuse.