Hello,
at first it looked easy, and that only line seemed enought ""BS_AUTOCHECKBOX | BS_PUSHLIKE".
but.. obviously, i want my button to be blue.
so after a nice day of internet searches, my button is blue:
"
void Bouton(LPDRAWITEMSTRUCT lpds, LPCTSTR texte, COLORREF couleurtexte, COLORREF couleurfond)
{
SIZE dims;
char nom[50];
strcpy_s(nom, texte);
GetTextExtentPoint32(lpds->hDC, nom, strlen(nom), &dims);
SetTextColor(lpds->hDC, couleurtexte);
SetBkColor(lpds->hDC, couleurfond);
BOOL etat = lpds->itemState & ODS_SELECTED;
int largeur = lpds->rcItem.right - lpds->rcItem.left;
int hauteur = lpds->rcItem.bottom - lpds->rcItem.top;
ExtTextOut(lpds->hDC, (largeur - dims.cx) / 2 + etat, (hauteur - dims.cy) / 2 + etat, ETO_OPAQUE | ETO_CLIPPED, &lpds->rcItem, nom, strlen(nom), NULL);
DrawEdge(lpds->hDC, &lpds->rcItem, (etat ? EDGE_SUNKEN : EDGE_RAISED), BF_RECT);
return;
}
"
- button is defined as bs_ownerdraw and the function is called as windows send the message WM_DRAWITEM -
but, the button do not stay down anymore.. . . .
so..... help... please..... i love u guys