Here is an OnCustomdraw() I copied from existing code and modified to do what you want it to do (hopefully). It is untested, so I don't actually know if it will work correctly (or even compile), but go ahead and try it out.
void CYourListCtrl::OnCustomdraw(NMHDR* pNMHDR, LRESULT* pResult)
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR );
// Take the default processing unless we set this to something else below.
*pResult = 0;
// First thing - check the draw stage. If it's the control's prepaint
// stage, then tell Windows we want messages for every item.
if ( CDDS_PREPAINT == pLVCD->nmcd.dwDrawStage )
*pResult = CDRF_NOTIFYITEMDRAW;
elseif ( CDDS_ITEMPREPAINT == pLVCD->nmcd.dwDrawStage )
// This is the prepaint stage for an item. Here's where we set the
// item's text color. Our return value will tell Windows to draw the
// item itself, but it will use the new color we set here.
// Do not apply special behavior if the list control is disabled.
int nItem = (int)pLVCD->nmcd.dwItemSpec;
// Always draw the selected item with the highlight color.
if (GetItemState(nItem, LVIS_SELECTED | LVIS_FOCUSED) != 0)
// Store the color back in the NMLVCUSTOMDRAW struct.
pLVCD->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
pLVCD->clrTextBk = GetSysColor(COLOR_HIGHLIGHT);
// Tell Windows to paint the control itself.
*pResult = CDRF_DODEFAULT;
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
I have a paper size and the num of image to be print on page.
if one image print over the page its working fine
but how can I identify the size of new image to print on page if multiple num of image print over the page,
like: if 40*40 is image size its print on 40*40 paper finally if only one image print over 1 page, if 2 image print on the page the image size should be 20*20 each print perfectly on page and occupy the whole area of page.
and also tell me how to arrange the images in printing like left to right or top to bottom ,to occupy the whole paper area by providing num of images on page.
I want to know how to create manifest for my c++ private assemblies. What I have done now is keeping a static manifest file(as show below) and embed it into the dll. The down side of this approach is that I cannot update the version number in the manifest file. I want to update the version in the manifest file with the version of dll.
Please advice me if anyone knows some details on creating manifest for "private assembly"
I would want to write a small chat program allowing to communicate across the Net.
But I only found classic Winsock samples with 1 server/clients, where clients need an ip address to connect with the server.
Isn't it possible to have only clients (which would probably be also servers for others clients) ?
(if I just have 2 executables on 2 different PCs, I cannot know the ip of the other client exe)