| 发表于:2007-07-14 12:25:385楼 得分:0 |
问题解决了,现分享代码如下: case wm_timer: for (i=0;i <64;i++) { invalidaterect(getdlgitem(hdlg,colorid[i]),lprect[i],false); } return true; break; case wm_ctlcolorstatic: for (i=0;i <64;i++) { deleteobject(hbrush[i]); hbrush[i]=0; if( lparam == (lparam)::getdlgitem( hdlg,colorid[i]) ) { rbg_r =palette[i*3+0]; rbg_g =palette[i*3+1]; rbg_b =palette[i*3+2]; } hdc hdc = (hdc )wparam ; ::settextcolor( hdc,rgb(rbg_r < <3,rbg_g < <3,rbg_b < <3)); ::setbkmode( hdc, rgb(rbg_r < <3,rbg_g < <3,rbg_b < <3) ); hbrush[i]=createsolidbrush( rgb(rbg_r < <3,rbg_g < <3,rbg_b < <3) ); return ( int_ptr )hbrush[i]; } break; | | |
|