Quote:
Originally Posted by sanjoy.saha@hcl.in
can u tell me why is this done as i am new to VC++
Because some of the features of API functions and structures are defined for specific Windows versions or highers.
For example :
Code:
//shellapi.h
typedef struct _NOTIFYICONDATAA {
DWORD cbSize;
HWND hWnd;
UINT uID;
UINT uFlags;
UINT uCallbackMessage;
HICON hIcon;
#if _WIN32_IE >= 0x0500
CHAR szTip[128];
DWORD dwState;
DWORD dwStateMask;
CHAR szInfo[256];
_ANONYMOUS_UNION union {
UINT uTimeout;
UINT uVersion;
} DUMMYUNIONNAME;
CHAR szInfoTitle[64];
DWORD dwInfoFlags;
#else
CHAR szTip[64];
#endif
#if _WIN32_IE >= 0x600
GUID guidItem;
#endif
} NOTIFYICONDATAA,*PNOTIFYICONDATAA;
As you see, as the constant _WIN32_IE has higher values, higher features are enabled.
[img]file:///C:/Temp/moz-screenshot-13.jpg[/img] [img]file:///C:/Temp/moz-screenshot-14.jpg[/img] [img]file:///C:/Temp/moz-screenshot-15.jpg[/img]
From MSDN :
Code:
Windows Server 2003 family _WIN32_WINNT>=0x0502
Windows XP _WIN32_WINNT>=0x0501
Windows 2000 _WIN32_WINNT>=0x0500
Windows NT 4.0 _WIN32_WINNT>=0x0400
Windows Me _WIN32_WINDOWS=0x0490
Windows 98 _WIN32_WINDOWS>=0x0410
Internet Explorer 6.0 _WIN32_IE>=0x0600
Internet Explorer 5.01, 5.5 _WIN32_IE>=0x0501
Internet Explorer 5.0, 5.0a, 5.0b _WIN32_IE>=0x0500
Internet Explorer 4.01 _WIN32_IE>=0x0401
Internet Explorer 4.0 _WIN32_IE>=0x0400
Internet Explorer 3.0, 3.01, 3.02 _WIN32_IE>=0x0300