DeviceIoControl() is a Windows kernel function that passes the request to the device specific driver. So there should be no differences on one machine when calling this from a VS 2003 or VS 2008 generated application or even any other programming language.
I have a listview REPORT with fullrowselect style everything works fine, but after i used customdraw I faced a problem such pic included, it seems I click on the item col 3 it becomes bold and more bold..
You must fill the cell rect with the background color before drawing the text. The CDC class provides the FillSolidRect() function which can be used to do this. When using DC handles, you can do it the same way as the CDC class:
i used SetBkColor(lpCD->nmcd.hdc, GetBkColor(..)); nothing happened, i do not set a bk color in my listview, i did set a row color manually... so If I do SetBkColor(lpCD->nmcd.hdc, RGB(255,0,0)); the whole list bk changed to red?
My example code is those used by CDC::FillSolidRect(). It will erase the cell using the actual background color of the HDC which can be set to the default returned by CListView::GetBkColor() or any other you are specifying (e.g. a row specific color).
You may of course use ExtTextOut() to print the cell text parts with different colors when adjusting the rect.
When using CListView::SetBkColor() this will set the default color for the list. When calling ::SetBkColor(HDC), this specifies the color for the drawing functions using the HDC.
If you change the background color (or the text color) of the HDC, you should restore it to the original value that is returned by the first set call. Restoring the colors may be omitted when all cells are owner drawn.