Posted on 1997-04-03
How do I use the setbkcolor API for a textbox by passing a window handle?
This is what I am doing:
1.declaring the setbkcolor and getDC API's at the module level.
2.At a form load, I pass the handle (hWnd) of my textbox to the GetDC API, to convert the hWnd handle to a hDC as follows:
l = getDC(text.hWnd) (BTW, l is a global long variable)
3. I call SetBkColor API as follows:
setBkcolor(l, RGB(255,0,0): this returns the value 255 meaning the code is being executed; but does not change the backcolor of my textbox to Red as it is supposed to.
What may be wrong??
Stepwise Suggestions welcome!!