CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2008
    Posts
    5

    Explorer style status bars.

    This is probably a common question but I couldn't come up with the right searches to find info on it.

    Basically I'm trying to find info on whether or not there is a proper win32 method to use the special status bar that microsoft apps use (firefox uses it as well). It has a drop shadow at the top of it and the resize control on it is made of dots instead of lines.

    I could roll my own but if a default way to use that one exists I'd prefer to use it.

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Explorer style status bars.

    CreateStatusWindow

  3. #3
    Join Date
    Sep 2007
    Location
    poland|wrocław
    Posts
    47

    Re: Explorer style status bars.

    Quote from MSDN2k7 april:
    Note This function is obsolete. Use CreateWindow instead.
    Check for proper STYLE value in msdn.

  4. #4
    Join Date
    Jan 2008
    Posts
    5

    Re: Explorer style status bars.

    Ok I'm a bit confused by the answers. The CreateStatusWindow function creates a default status window.

    I want the alternative status window Microsoft apps use. I had assumed it was a special case control (sort of like rebar vs normal tool bars).

    It could be just an alternative visual style but I can't find any info alluding to that.

    The older status bar seems to use an deprecated resizing grab bar style and it uses sunken edge boxes/dividers instead of the newer looking drop shadow and thin line dividers.

    If there is a special style to stipulate to CreateWindow I can't find it via MSDN.

  5. #5
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Explorer style status bars.

    If you have Spy++ tool, launch it, drop the Spy finder tool on the statusbar you are referring to.
    For this window, if the class name shows up as "msctls_statusbar32" defined in commctrl.h, it is the windows common control, otherwise it is a custom control. If it IS the windows common control class, look at the styles used for it and apply the same for your status bar

  6. #6
    Join Date
    Jan 2008
    Posts
    5

    Re: Explorer style status bars.

    Quote Originally Posted by kirants
    If you have Spy++ tool, launch it, drop the Spy finder tool on the statusbar you are referring to.
    For this window, if the class name shows up as "msctls_statusbar32" defined in commctrl.h, it is the windows common control, otherwise it is a custom control. If it IS the windows common control class, look at the styles used for it and apply the same for your status bar
    Thanks I don't have Spy++ so I hadn't thought of using a tool like that. I d/led winspector though and it is in fact the common control afterall.

    The unfortunate news is even when I set the styles/exstyles the same it still uses the incorrect sizing grip and draws differently.

    The only difference WinSpector lists is the new style ones have a second value listed in the "properties" row. It just says Atom: #43282 0x0001007 (65543).

    I'm not sure what that refers too yet but at least this gives me a new direction to look at.

  7. #7
    Join Date
    Jan 2008
    Posts
    5

    Re: Explorer style status bars.

    Hmm further exploration is leading me to nothing. All the proper status bars have that ATOM listed in Winspector but it's not referring to a window class ATOM from what I can tell.

    The only other difference I can find is the new style is unicode but the older style is ANSI. I can't even find info on the net addressing the fact that there are two completely different drawing styles for the msctls_statusbar32 window class.

    My hunch at this point is that it has something to do with me using mingw. Perhaps its linking against an older version of msvcrt.dll.

  8. #8
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Explorer style status bars.

    Quote Originally Posted by dorn
    My hunch at this point is that it has something to do with me using mingw.
    I don't know what mingw is. Is it a compiler? If it is, that in itself cannot be the reason. Ultimately, windows will do what it is told to do ( commctrl.dll ) and all that depends on how the statusbar styles are set and if they are owner drawn etc.

    Perhaps its linking against an older version of msvcrt.dll.
    msvcrt.dll doesn't have any drawing functions. It is just the c-runtime library. The controls are implemented in user32.dll and commctl32.dll.
    But you do bring up a good point. It could be that it is using a different commctl32.dll. One way to verify which version your app is linking to which one firefox is linking to is to see what version of commctl32.dll is loaded.

    For this, I recommed using process explorer
    • Download, install, run both exes and launch process explorer.
    • Find your exe in the list and select it
    • Go to menu , view and make sure "Show Lower Pane" is checked.
    • Go to menu , view->Lower Pane View and make sure DLLs is checked. The lower pane should now show all the dlls loaded.
    • Locate commctl32.dll in the list and note down the path and version info for it.
    • Similarly, do it for the other exe and compare.


    Perhaps, you can post images of how the 2 look and also the styles each one has per winspector.
    Last edited by kirants; January 6th, 2008 at 11:34 AM. Reason: clarified

  9. #9
    Join Date
    Jan 2008
    Posts
    5

    Re: Explorer style status bars.

    Quote Originally Posted by kirants
    I don't know what mingw is. Is it a compiler? If it is, that in itself cannot be the reason.
    It is a compiler but that isn't what I meant. Mingw is a windows implementation of GNU tools in general. The mingw compiler has a slightly different symbol syntax for telling the linker how to load up a DLL though. Thus all the libs to load up stuff like commctrl32 are rewritten and can possibly link vs a different version.

    Thanks for the tip on commctl32. I'd forgotten about that and it would of thrown me for a loop when I got back to this and tried looking at the wrong library.

    Apparently all the MS apps are using a commctl32 in the WinSxS directory and the one in system32 is the culprit drawing the older style status bars.

  10. #10
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Explorer style status bars.

    You need a manifest to link to the WinSXS one. It's an XML file that can be embedded into the exe , or , can be dropped alongside the exe.

  11. #11
    Join Date
    Jan 2008
    Posts
    1

    Re: Explorer style status bars.

    HWND hSB=CreateStatusWindow( WS_CHILD|WS_CLIPSIBLINGS|WS_VISIBLE|SBARS_SIZEGRIP,0,hDlg,100);
    will make a status bar just like the windows taskmgr's

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured