You may just rotate the window client area paintings. If you need to rotate, for instance, window controls then you have to draw yourself them (and you cannot easily rotate, for instance, the window title bar).
For rotating client area paintings, each pixel should undergo the transformation:
x' = -x
y' = -y
where
{x',y'}
are the new coordinates, and
{x,y}
are the old ones, all expressed with respect the window (client area) center.
That means
"the new RGB value of the point P(x,y) must be equal to the old RGB value of the point Q(-x,-y)".