I am trying doing subclassing in Winapi. I want to change the background color when mouse is over the button. But I am not getting the desired output.The code has been attached.
I am just getting a small portion of the window to be painted red instead of the entire window that I desire.
Any suggestions would be appreciated! :)
GetWindowRect() returns screen coords while FillRect() uses client coords.
You also have a GDI leak.
PS Please post code, not files.
Only because I have finished my current project 8 weeks early (in a 13 week project) and need to kill some time, did I bother to look at your code.
Ok.. but I didn't post the code because the indentation was lost when I tried posting it, while my code was indented when I worked in Visual Studio. Regarding the problem, the output which I wanted from the above code, I got it without using subclassing ... So no need to answer this question now!
Anyways thanks for replying and do tell me how to keep the indentation while posting the code here. :)
Use CODE tags to keep the indentation. ( square brace 'code' square brace to open then square brace '/code' square brace to close)
leading spaces and TABs are retained inside code tags