Why is it that in my commctrls.h some things such as using CDIS_SELECTED (used to determine state of control when custom drawing) I can't use. The compiler says that i.e. CDIS_SELECTED undeclared first use this function.

#if (_WIN32_IE >= 0x0300)
#define CDIS_CHECKED 8
#define CDIS_DEFAULT 32
#define CDIS_DISABLED 4
#define CDIS_FOCUS 16
#define CDIS_GRAYED 2
#define CDIS_HOT 64
#define CDIS_SELECTED 1
#define CDIS_MARKED 128
#define CDIS_INDETERMINATE 256
#if (_WIN32_WINNT >= 0x0501)
#define CDIS_SHOWKEYBOARDCUES 512
#endif

This is an extract from the file commctrls.h

I think I understand the meaning of this, i.e. simply its so outdated versions of windows can't use certain things.

My point is that I am using Windows XP SP2, which honestly isn't that outdated. My Compiler is the latest of Dev-C++ w/ MinGW.

What is it that _WIN32_IE >= 0x0300 mean exactly and why can't I used some of these things, the same things also happens with InitCommonControlsEx(..) etc.

Thanks

Recommended Answers

All 6 Replies

>>WIN32_IE

Version of Internet Explorer -- has little, or nothing, to do with the version of MS-Windows except that it must support IE3 or newer. If that section of code is getting skipped by your compiler's preprocessor then define _WIN32_IE to be at least 0x300 to 0x700 (version 3 to version 7).

>>_WIN32_WINNT
That is the minimum version of MS-Windows that your program should support.

Would I simply just define that in my application I am writing or would there be a way to adjust the compiler to recognise it?

I am running IE 6.0 I think.

I've tried defining it in my app as 0x0600 but I still get the same error..

#define _WIN32_IE 0x0600

worked for me with Dev-C++ compiler.

#define _WIN32_IE 0x600
#include <windows.h>
#include <commctrl.h>
// rest of the program here

Oh I take that it matters where you define it in the program, I defined it AFTER including the header files, which I guess technically its incorrect. Thanks anyway. You know how to make it so I don't have to do this every single time?

Thanks.

I tried defineing it in Tools --> Compiler Options, but it didn't work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.