3,245
社区成员
发帖
与我相关
我的任务
分享
// CMyAnimateCtrl
BOOL CMyAnimateCtrl::RegisterMyself()
{// Register the window class if it has not already been registered.
WNDCLASS wc;
HINSTANCE hInst = AfxGetInstanceHandle();
if(!(::GetClassInfo(hInst, "MySysAnimate32", &wc)))
{// otherwise we need to register a new class,must have CS_OWNDC !
wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;// | CS_OWNDC;// | CS_GLOBALCLASS;
wc.lpfnWndProc = ::DefWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;//SPINCUBE_EXTRA;//=4
wc.hInstance = hInst;
wc.hIcon = NULL;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = NULL;
wc.lpszMenuName = (LPSTR)NULL;
wc.lpszClassName = (LPSTR)"MySysAnimate32";
if (!AfxRegisterClass(&wc))
{
AfxMessageBox("Register a custom control failed!");
return FALSE;
}
}
return TRUE;
}