i'm working on an app with a toolbar across the top. I'd like to add a strip above the toolbar where I can put some more controls (a couple combo boxes, maybe some more buttons). I can't quite figure out how to do this.
Shoiuld I
- create a child window to fill this strip, and put the controls there? or
- just open up a strip of parent window and put the controls there?
To see if the second method would work, I tried moving the toolbar window down by using MoveWindow(), but no matter what value I passed it for
Y, the window remained stuck where it was, at the top of the parent's client area. So it seems this is the way toolbars were designed to work, at least by default. I looked for some styles that might allow me to move it, but didn't find anything.
I
don't want a floating toolbar (i.e, one that can be picked up and moved by the user), just to move it down and put some other stuff above it. If this doesn't work, I guess I could put my other controls below the toolbar, but I'd really rather have them above.
I have lots of programs that do just this, so I know it's possible, just don't know how. Hopefully this can be done without subclassing, using plain vanilla Windows stuff.
I think you are looking for "rebar" Sr NoCforMe.
Hmm; I've been seeing that term a lot on MSDN but hadn't bothered trying to find out what it was. Now I know.
Not sure that's what I want. Apparently you can only put one child window (e.g., a combobox control) in each band, so I'd have to create multiple bands. I was hoping for something a little simpler. But I've got rebars bookmarked ...
Here is a list of candidates (http://msdn.microsoft.com/en-us/library/windows/desktop/ff486063%28v=vs.85%29.aspx), and TB_SETBOUNDINGSIZE is one of them. You may need subclassing, though.
Well, after digging around in MSDN a while, I found another way to do this (http://msdn.microsoft.com/en-us/library/hh298391%28v=VS.85%29.aspx). (Look, Ma, no subclassing!)
Quote
Well, after digging around in MSDN a while, I found another way to do this. (Look, Ma, no subclassing!)
An interesting soluce to create the same thing as a rebar without his many advantages .
With a rebar,you can move and resize the bands with the mouse.
This need no line code to work.
Quote
you can only put one child window (e.g., a combobox control) in each band
This need to be verify.
I have verify that a band could have only one child window (only one combo),it's false.
Here is a simple sample.
Quote from: ToutEnMasm on November 22, 2011, 09:40:08 AM
Quote
Well, after digging around in MSDN a while, I found another way to do this. (Look, Ma, no subclassing!)
An interesting soluce to create the same thing as a rebar without his many advantages .
With a rebar,you can move and resize the bands with the mouse.This need no line code to work.
But I don't want those "advantages". I don't want the band to be resizeable, or moveable, or configurable. I just want a place to park some additional controls.
So to get back to my original question (remember that?), is there any way I can open up some (parent client area) space above a toolbar and put controls in that space?
Or do toolbars have "magnets" that keep them firmly fixed to the top of their parent windows? (This appears to be the case, as I've tried to use MoveWindow() to move the toolbar down, but it didn't work.) This would still be my first choice in my situation.
I have tried it, and movewindow do not have worked like you say. Now I understand.
So, I played with it, thinking that toolbar is fixed on the upper, but if you set some styles, you can put the toolbar to down.
TBSTYLE_ALTDRAG OR TBSTYLE_FLAT OR TBSTYLE_TRANSPARENT OR CCS_BOTTOM OR CCS_NOMOVEY OR CCS_TOP OR WS_CHILD OR WS_OVERLAPPED OR WS_VISIBLE
In microsoft site have one tool to play with messages and styles of controls, I use that tool before code. (Control Spy 2.0). I'm now investigating the messages received to toolbar control to see if I can give you one answer.
CCS_NOMOVEY does the trick, see attachment - thanks mineiro :U
You can use CCS_NOMOVEY with CCS_NORESIZE, so movewindow will work. :U
I'm confused. (A not uncommon state of affairs.)
MSDN says (http://msdn.microsoft.com/en-us/library/windows/desktop/bb775498%28v=vs.85%29.aspx) about CCS_NOMOVEY: "Causes the control to resize and move itself horizontally, but not vertically, in response to a WM_SIZE message.".
Wouldn't I want to use CCS_NOMOVEX instead, since I want to be able to move the toolbar vertically but not horizontally?
jj, I downloaded your example, but cdt.exe doesn't open a window or even show up on the taskbar. ????? Kinda creepy to have a process running that's a ghost ...
Hello Sr NoCforMe, I have downloaded jj2007 example and worked here, and appears in taskbar. Depending of style of window, they do not appear in taskbar, follows one that do not appear.
My mistake (sorry) before when I have said that "CCS_NOMOVEY with CCS_NORESIZE" can be combined, because one cancels other.
I have done one example that do not deal with CCS_NOMOVEY, only CCS_NORESIZE and worked.
I think this happens depending of what messages you are treating.
Quote from: NoCforMe on November 23, 2011, 01:26:17 AM
jj, I downloaded your example, but cdt.exe doesn't open a window or even show up on the taskbar. ????? Kinda creepy to have a process running that's a ghost ...
Which OS? You can use Process Manager 8right-click on Windows taskbar) to kill the process.
Thank you, I know how to kill a process (Win2K here, so I use Task Manager). Why doesn't the app show itself? Just curious.
Quote from: NoCforMe on November 23, 2011, 06:35:26 AM
Thank you, I know how to kill a process (Win2K here, so I use Task Manager). Why doesn't the app show itself? Just curious.
Sorry, I saw you were scared of ghosts so I thought it's better to give details :bg
Quote from: NoCforMe on November 23, 2011, 01:26:17 AM
Kinda creepy to have a process running that's a ghost ...
Re the why: I stole the app from Xandaz (http://www.masm32.com/board/index.php?topic=16732.msg139274#msg139274), and he uses a Windows XP manifest. Try commenting out the manifest in rsrc.rc:
//IDR_XPMANIFEST1 MANIFEST "xpmanifest.xml"
Quote
But I don't want those "advantages". I don't want the band to be resizeable, or moveable, or configurable. I just want a place to park some additional controls.
see http://msdn.microsoft.com/en-us/library/windows/desktop/bb774393(v=vs.85).aspx
Quote
RBBS_FIXEDSIZE The band can't be sized. With this style, the sizing grip is not displayed on the band
Quote from: ToutEnMasm on November 23, 2011, 08:07:16 AM
see http://msdn.microsoft.com/en-us/library/windows/desktop/bb774393(v=vs.85).aspx
Quote
RBBS_FIXEDSIZE The band can't be sized. With this style, the sizing grip is not displayed on the band
Thanks. I've got that bookmarked and will experiment with it.
Quote from: jj2007 on November 23, 2011, 07:55:32 AM
Try commenting out the manifest in rsrc.rc:
//IDR_XPMANIFEST1 MANIFEST "xpmanifest.xml"
Did you try?
Well, I remade the program but it made no difference. Commented out that manifest line like you told me to, assembled & linked, still no visible window nor appearance in the taskbar.
That's the limit of my patience and my curiosity concerning this. Life's too damn short ...
Quote from: NoCforMe on November 24, 2011, 12:30:21 AM
Well, I remade the program but it made no difference. Commented out that manifest line like you told me to, assembled & linked, still no visible window nor appearance in the taskbar.
That's the limit of my patience and my curiosity concerning this. Life's too damn short ...
You are using Win2K, that's a bit ancient. With a debugger, one could find out where it fails...