Can I remove the caption in a CDockablePane - c++

I'm porting a MFC application to use the Ribbon UI and MFC feature pack and would like to have a docked horizontal pane that does not include a caption. I'd hope that something like
MyPane.ModifyStyle(WS_CAPTION, 0);
m_pParentFrame->RecalcLayout();
would work, but no joy. FWIW, the docking pane is hosting a wide horizontal dialog docked under the main view and the caption wastes more desktop real estate than I'd like to give away.
Edit: Further googling found a possible solution here: http://www.sibisa.com/remove-hide-title-bar-board-cdockablepane-window/
Edit2: EnableGripper(FALSE) was what was needed, see https://msdn.microsoft.com/en-us/library/bb984118.aspx

Calling EnableGripper(FALSE) removes the caption.

Related

How to create a borderless window with titlebar in windows c++

I am trying to create a Direct3D app that is operating in windowed mode with a title bar and minimize/quit button. However, I'd really like to be able to axe the border around the window.
I am looking to do this because it looks pretty cheesy on dual monitors when the app is filling the primary monitor horizontally (with room to move the app vertically), but its window border overflows onto the secondary screen. I've tried a bunch of combinations of setwindowlong with GWL_STYLE and GWL_EXSTYLE, but can't seem to make headway unless I disable the title bar.
I've seen a bunch of apps that are borderless however they seem to emulate the title bar rather than using the built in one provided by Microsoft.
Thanks for any suggestions.
You can't remove the border and keep the titlebar AFAIK.
You can reimplement the titlebar by using WM_NCHITTEST but you still need to draw it yourself which would not be a bad idea if you want your D3D app to look its best.
Visual Studio, last time I checked, achieves its border with transparent layered windows standing behind the primary one. They are the shadows you see.

C++ WinAPI - How to make button appear pressed?

I have in my editor few editing modes. I can choose specific mode using buttons that are placed on a toolbar. I want to indicate which mode is currently on. When I press appropriate button - I want to make the clicked button remain pushed. How do I do that in WinAPI? My toolbar uses bitmaps for icons if that's relevant.
There used to be a way to get something like the look and feel of a toolbar by using a normal check box with the BS_PUSHLIKE style set. But that got broken a bit with Windows XP because of mouse hover effects, so it's not widely used any more.
If you want to create your own toolbar, without the help of MFC, there is an MSDN article that covers the creation and management of a toolbar window (actually a dedicated window class as part of the Common Controls Library).

Needed: A popup window without a taskbar icon

I am designing a UI engine that needs to render into popup (WS_POPUP) windows. As these windows cannot be children of other windows, each instance is given its own taskbar icon.
I need a way to prevent the taskbar icons from appearing for certain windows that are created as "dialogs". I cannot use an OS-provided dialog because they all have frames (and I can't figure out how to render into them) or a tool-created custom dialog (which seem to require the CLR).
I am not an expert with the windows API and I feel that I have missed something obvious...
Also: Anything involving CLI/CLR is not an option.
EDIT:
The WS_EX_NOACTIVATE style can be used for this purpose as well, though the activation behavior would need to be emulated by the program.
If you set the WS_EX_TOOLWINDOW extended style for your window, it won't be shown in the task bar or Alt+Tab list. This does cause the window to be rendered slightly differently, however (thinking floating tool palette).

How are controls put in the caption bar?

I noticed Firefox 4, Opera and Chrome, and IE 7/8 put buttons and controls in the title/caption bar, how is this done?
Thanks
http://img199.imageshack.us/img199/3307/slayerf.png
alt text http://img199.imageshack.us/img199/3307/slayerf.png
What they probably do is turn the caption bar off entirely (by excluding the WS_CAPTION window style), add a glass area to the top of the window, and then draw their own controls.
See http://msdn.microsoft.com/en-us/magazine/cc163435.aspx for more on glass.
Probably they simply handle the WM_NCPAINT message and draw part of the non-client area (which includes the borders and the caption bar) by themselves; they will also handle WM_NCLBUTTONDOWN, WM_NCHITTEST and other WM_NC* messages to emulate the behavior of a button on the caption bar.
Or at least, this was the way it was commonly done before Aero; I don't know how much it changed this kind of things.
Yes, you can do that.. you have use window hooks, insert your dll in remote process and run the function of dll remotely. here is full fledged article dealing with it :-
http://www.codeproject.com/KB/threads/winspy.aspx

Need help adding scroll bar to edit box

I'm making an MFC dialog-based application in Visual C++ 2005. I added a scroll bar to an edit box. How do I program the scroll bar to make it work?
The windows styles wS_VSCROLL and WS_HSCROLL control if there is a scroll bar present or not. Normally you just setup these styles as part of the resource dialog template.
With MFC you use the "CWnd::ShowScrollBar" method to turn the scroll bar on/off.
When scrollbars are turned on, then they should work automatically for edit controls. You don't need to do anything.
http://www.functionx.com/visualc/controls/scrollbar.htm
has code you can use to control the scroll bar.