1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
long fnListSubClass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
switch(msg){
case WM_NCCALCSIZE: {
CallWindowProc(listboxProc, hwnd, msg, wParam, lParam);
RECT* pRect = (RECT*)lParam;
pRect->left+=4;
return 0;
}
case WM_NCPAINT: {
HBITMAP brush;
HBRUSH newBrush;
HGDIOBJ oldBrush;
HDC hdc;
RECT rect;
hdc=GetWindowDC(hwnd);
GetClientRect(hwnd, &rect);
SetRect(&rect, 0, 0, 4, rect.bottom);
brush=LoadBitmap(GetModuleHandle(0), MAKEINTRESOURCE(IDB_BORDER));
newBrush=CreatePatternBrush(brush);
oldBrush=SelectObject(hdc, newBrush);
FillRect(hdc, &rect, newBrush);
SelectObject(hdc, oldBrush);
DeleteObject(newBrush);
UpdateWindow(hwnd);
ReleaseDC(hwnd, hdc);
break;
}
}
return CallWindowProc(listboxProc, hwnd, msg, wParam, lParam);
}
|