NO

Author Topic: commctrl not showing correctly, maybe includes are wrong ?  (Read 2215 times)

benjaminmaggi

  • Guest
I'm working with toolbars and I decided to put them inside a RebarWindows (aka CoolBars).
I remember a code example on johnfindlay site, http://www.johnfindlay.plus.com/lcc-win32/comctrl/ReBar.zip.
I Ctrl+C & Ctrl+V here and there, and then I hit the execute button, to my surprise I saw nothing.
I then used WinSpy to locate my RebarWindow32, I found that the window it's there, but it only has 4 pixel height ? wired...
I tried to use WinSpy to change the rebar height but nothing...
I worked on for many hours, changing the mask bytes, rewriting the code, smoking and drinking coffe like a pig.
I've BC++5.5 on my disk :o, I decided to build my sources with it, and voilá, it works.
Since I've both PellesC 4.50 and 5.0 Maybe some include options got mix up, but that's not the case.
I've checked commctrl.h and the problem is REBARBANDINFO structure.
Specifically If I comment:

//#if (_WIN32_WINNT >= 0x0600)
//    RECT rcChevronLocation;
//    UINT uChevronState;
//#endif /* _WIN32_WINNT >= 0x0600 */

It works..., Im missing something or it's a bug in the size calculation ?

Please download the source from John site and try to build it yourself see what I mean...
« Last Edit: May 11, 2008, 10:54:27 AM by benjaminmaggi »

JohnF

  • Guest
Re: commctrl not showing correctly, maybe includes are wrong ?
« Reply #1 on: May 11, 2008, 01:10:31 PM »
If you define this before including windows.h

#define _WIN32_WINNT 0x0500

it will be ok.

I don't fully understand why adding this to the header

#if (_WIN32_WINNT >= 0x0600)
    RECT rcChevronLocation;
    UINT uChevronState;
#endif /* _WIN32_WINNT >= 0x0600 */

causes a problem.

Maybe since 0x0600 the struct must be filled in differently.

John