MFC VC++: How to remove blank space between the Window caption and Client area - c++

I am developing a desktop app using MFC. The following image shows the current state of the app's window top part. The area marked in red is unnecessary and I want to remove it.
How can I remove that space or atleast change the color to match the rest of the window background?
More Info:
The App is using Ribbon UI. I have added the App button programmatically in onCreate of CMainFrame. Is it the bar that holds the Ribbon categories? I tried SetMenubarState(AFX_MVS_HIDDEN) thinking it was the menu bar, but that didn't work. Just changing its color is also acceptable.
Update:
I have managed to change the color of that ribbon strip, and removed the caption bar I used for showing the 'add' button. Now I need to figure out how to place the 'Add' button on the right side of the ribbon strip.

Related

How to ignore the accent color on Windows 10?

On Windows 10, you can turn on an accent color on the title bar of windows via Personalization settings.
Could a window of my app ignore that preference and display like if the setting is disabled? All the tricks I found in the web are just drawing own title bar (usually using a framework). Is there no simpler way to do that?
UPD: I need to draw an image on the window. The image should be partly inside the rect of the title bar, partly outside. For that reason, I need visually hide the boundary between the title and the client area.

MFC - CPropertyPageEx and scaling (4K monitor)

I'm upgrading an old MFC app to support 4K monitors. According to what information I can find, CPropertySheetEx 'implements Wizard97 style functionality'. It's a dialog with Previous and Next buttons and a banner.
Now MFC has done a poor job of scaling this dialog and I'm not sure what control I have over it.
4K is usually 200% scaling. The banner height is unchanged at 59 pixels (so is too small on a 4K monitor). The rest of the dialog seems to have scaled to about 150% (width, height).
I've tried SetWindowPos on the banner. This doesn't resize it and causes other dialog issues.
There's this note in the code, which makes me think the banner is dynamically constructed with the property sheet.
// If the page has a header, we need to paint the area above the border.
// By inspection (Spy++), the border is a static control with ID 0x3027
CWnd* pTopBorder = GetDlgItem(0x3027);
Any suggestions or guides would be appreciated.
The app is DPI aware. Many MFC components scale properly (some need some work)
Question - How can I get CPropertyPageEX dialogs to support scaling?
Here's an image ![Scaling Issue]https://imgur.com/a/Ww8SLnU
Edit -
The icon and the text in the banner can be resized and repositioned, only the height of the banner seems stuck at 50 pixels.
CPropertyPageEx is defined as CPropertyPage in MFC 11. It's derived directly from CWnd.
Having a look at the sources for CPropertyPage (atlmfc\src\mfc\dlgprop.cpp) there's no constructor where it creates buttons or banners (so I may be looking in the wrong place).
A PropertySheet seems to consist of
a graphic (user supplied),
a horizontal bar (static control),
a dialog resource from the Property Page currently displayed
another horizontal bar
a series of buttons (Prev , Next etc)
Have a look at my high def screenshot https://imgur.com/a/yR97H96
The dialog and controls have rescaled
The vertical position of the horizontal bar and the property page are both unchanged from the unscaled version, leading to the ugly overlap you can see.
.

C++ Win32 how to remove tab borders WC_TABCONTROL

Hi I am trying to convert an existing WC_TABCONTROL window with TCS_OWNERDRAWFIXED so that I have full control of its appearance.
But it seems all I can draw is the tab headers and even there I do not have much control on how the borders are drawn around tab page as well as tab headers.
Can someone point me to some material that explain how to custom draw, tab items and tab pages. I need to have control on how both the background and borders are drawn.

Refreshing display objects after resizing

I have an app that contains a CControlBar and in that sits a few CStatic Objects which each display an icon with some text.
I have a bug where if I keep resizing the control bar a bit using the mouse, all the text and icons on the control bat as well as other icons and menu item texts across my whole app go invisible / break.
Is there a specific type of redraw function of a specific class that i should be using from the onSize method? or is there something else i need to be doing?
Thanks

Float a control over a CView

I've got an app that uses several CView-derived classes (actually CScrollView) to display document data. For one particular view, I want to add a fly-out edit box to add notes. That is, you'd see a tab at the bottom of the window labeled "Page Notes", and clicking on that would bring up the edit box. Clicking the tab while the edit box is visible would reduce it back to just the tab.
I thought I could use a one-tab CTabCtrl holding an edit box and just position it so that only the tab is visible initially. Capture the tab click notification and move the entire control, with edit box, into view. Clicking the tab again would move it back down so only the tab is visible.
Hosting the CTabCtrl on the CView is fine, and I can get it positioned correctly. The problem is that if the view is scrolled, the tab control is scrolled along with it, whereas I need it to "float" over the view and not be affected by any scrolling. I can move it back into place after the scroll, but the flickering is unsightly.
Is there a straightforward way to accomplish the "floating" effect? I mainly want the tab embedded in the view for maintenance, since it's the only view class out of the several in use that needs the "Page Notes" feature.
Should I just buckle down and put the tab in the view's parent window instead? I know it won't be affected by scrolling there, but I like the idea of keeping the tab as part of the view if possible.
It sound like the tab is functioning like a button. You click the tab and a fly out edit box appears. You could use a modeless dialog.
Select the "Page Note" and the modeless dialog comes up to edit your notes allowing you to scroll your view under the dialog.