Access to the extended toolbar button styles

Hello, me again
I have a toolbar TBBUTON and a lot of style that could be applied to it. Unfortunately only a few of them work (TBSTYLE_BUTTON, TBSTYLE_SEP and a few more). When I try to use styles like TBSTYLE_FLAT or TBSTYLE_TRANSPARENT the complier says that the constant 'was not declared in this scope'.
What library am I missing? Do I have to initialize some function?
Thank you for your answers
Look at that styles in msdn, it will tell you exactly what headers you need to include.
By these lines of the <commctrl.h> header

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#if (_WIN32_IE >= 0x0400)
#define TBSTATE_MARKED	0x0080
#endif
#define TBSTYLE_BUTTON	0
#define TBSTYLE_SEP	1
#define TBSTYLE_CHECK	2
#define TBSTYLE_GROUP	4
#define TBSTYLE_CHECKGROUP	(TBSTYLE_GROUP|TBSTYLE_CHECK)
#if (_WIN32_IE >= 0x0300)
#define TBSTYLE_DROPDOWN	8
#endif
#if (_WIN32_IE >= 0x0400)
#define TBSTYLE_AUTOSIZE	16
#define TBSTYLE_NOPREFIX	32
#endif
#define TBSTYLE_TOOLTIPS	256
#define TBSTYLE_WRAPABLE	512
#define TBSTYLE_ALTDRAG	1024
#if (_WIN32_IE >= 0x0300)
#define TBSTYLE_FLAT 2048
#define TBSTYLE_LIST 4096
#define TBSTYLE_CUSTOMERASE 8192
#endif 


it seems like TBSTYLE_FLAT or TBSTYLE_TRANSPARENT is enabled depending on _WIN32_IE. I have Windows 7 on my computer, with IE9. I don't understand what happens.
You also have to include commctrl.lib in your libraries. Have you done that?
If you don't explicitly #define _WIN32_IE, then it is automatically #defined to the highest version of IE that was available when the SDK was packaged. This means that if you are using the SDK 7.1 (Windows 7), _WIN32_IE is 0x0800, Internet Explorer 8.

Since it is highly unlikely that you are using an SDK so old that _WIN32_IE is less than 0x0300, the most probable cause is you are not #including the right header just as modoran stated in the first place. See http://msdn.microsoft.com/en-us/library/aa383745(VS.85).aspx to understand how to use the Windows header files.
if you use Mingw then you must define manually _WIN32_IE and _WINVER, I think by default you can write programs for windows 95 with that. Trying to use windows 7.1 SDK WIth mingw gives me an error 'sal.h' not found, but the file exists on my system ...
That's why I prefer to use VS for windows programming ...
Topic archived. No new replies allowed.