bool cmycwnd::create(cpoint p, cwnd *pparentwnd, colorref crcolour)
{
assert(pparentwnd && ::iswindow(pparentwnd->getsafehwnd()));
m_pparent=pparentwnd;
cstring szclassname=afxregisterwndclass(cs_classdc|cs_savebits|cs_hredraw|cs_vredraw,
0,
(hbrush)(color_btnface+1),
0
);
if(!cwnd::createex(0,szclassname,_t(""),ws_visible|ws_popup,
p.x,p.y,115,120,
pparentwnd->getsafehwnd(),0,null
))
return false;
m_btntest.create("test",ws_child|ws_visible|bs_pushbutton,crect(10,60,50,80),this,123);
[color=#ff0000]setcapture(); //在这里[/color]
return true;
}