Malcolm,
I am just about to do this for a .NET control but I believe you need to do some of the following:-
1] Determine if the version of the OS supports themes.
2] If it does find out if themes are in use using something like:-
declare integer IsThemeActive in UxTheme
3] Now pick the relevant colour indexes for the gradient using the following:-
declare integer GetSysColor in user32 integer nIndex
I think the gradient is based on a combination of the following entries:-
COLOR_GRADIENTACTIVECAPTION
COLOR_ACTIVECAPTION
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getsyscolor.aspSorry for being vague, but like I said I am about to start implementing this support.
Regards
Neil