用spy++仔细看了,在下拉框打开时,不响应WM_NCPAINT消息,所以打印出所有消息,确定在70,71消息时强制刷新次
代码如下:
case WM_WINDOWPOSCHANGED: OnNcPaint(psb, (HRGN)1); break; case WM_WINDOWPOSCHANGING: OnNcPaint(psb, (HRGN)1); break;
句柄可通过
if(WM_CTLCOLORLISTBOX == message) { HWND hListBox = (HWND)lParam;
也可通过外部的
COMBOBOXINFO ci = {sizeof(ci)}; ci.hwndList
打印出来,肯定两者是同一个hwnd