After exploring websites and documentations i found that ExtTextOut is the fastest among all other options i had mentioned.
Now after few trial and errors i made the setbkcolor and settextcolor to work with exttextout.
I didn't assume the behavior of setbkcolor and settextcolor would be like the old 16bit C graphics functions from Borland.
Now instead of using like the vb6.0 way of coloring a static control i am using the ExtTextOut function with ETO_OPAQUE to apply a background color the the rectangle i needed.
I don't know whether the above code(in my original question) works or not but the following code worked.
As i had said in the question that my need is to pick the color beneath the mouse pointer and to fill a rectangle. all i was confusing was how to setbackground color and now i got it. here it is...
HDC hdc = GetDC(hwnd); SetTextColor(hdc,RGB(0,200,200));
SetBkColor(hdc, RGB(0,0,200));
ExtTextOut(hdc,110,110,ETO_OPAQUE,&rect,"hehehaha",8,0);
it is the same like setcolor followed by setbkcolor followed by outtextxy in Turbo C. hhhmmm... phew... somehow forgot the old style. :)
If anybody would like to correct me of anything here then please go on...