To use GDI you'll need the GradientFill function. You can also use GDI+ to get gradients. Here's a plain GDI example:
TRIVERTEX vert[2] ;
GRADIENT_RECT gRect;
vert [0] .x = 0;
vert [0] .y = 0;
vert [0] .Red = 0x0000;
vert [0] .Green = 0x0000;
vert [0] .Blue = 0x0000;
vert [0] .Alpha = 0x0000;
vert [1] .x = 100;
vert [1] .y = 32;
vert [1] .Red = 0x0000;
vert [1] .Green = 0x0000;
vert [1] .Blue = 0xff00;
vert [1] .Alpha = 0x0000;
gRect.UpperLeft = 0;
gRect.LowerRight = 1;
GradientFill(hdc,vert,2,&gRect,1,GRADIENT_FILL_RECT_H);
As for the tab control, you could sub-class the control and override its non-client and client drawing handlers to render the gradient.
To sub class a control, first create the control and then replace its WNDPROC function:
OldWndProc = (WNDPROC)SetWindowLongPtr (hControl, GWLP_WNDPROC, (LONG_PTR)NewWndProc);
then, in your new WNDPROC:
NewWndProc (usual args)
{
switch message
{
case paint:
draw gradient
return result
default:
return CallWindowProc (OldWndProc, ..args..); <- important!
}
}