我从CWnd继承了一个类,发现一个很怪的现象:如果我在这个类上绘图的话CPU占用率很低,几乎是0。但是始终显示一个表示忙的漏斗光标,这样用起来很不爽。我的绘图操作没有占资源的话,是什么造成出现表示忙的漏斗光标?有懂这个的指点一下,万分感谢。
下面是我的代码:// NewWnd.cpp : implementation file
//#include "stdafx.h"
#include "NewWnd.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// CNewWndCNewWnd::CNewWnd()
{
m_nStyle       = 0;
m_clBkColor    = RGB( 255, 255, 255 );
m_bShowCursor  = FALSE;
m_bTopMost     = TRUE;
}CNewWnd::~CNewWnd()
{}
BEGIN_MESSAGE_MAP(CNewWnd, CWnd)
//{{AFX_MSG_MAP(CNewWnd)
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNewWnd message handlers
int CNewWnd::Create( CWnd* pParentWnd, UINT nStyle, UINT nID )
{
m_nStyle = nStyle;
return CreateEx(
0,
NULL,
NULL,
WS_POPUP | WS_VISIBLE,
CRect( 0, 0, 0, 0 ),
pParentWnd,
nID );
}
BOOL CNewWnd::PreCreateWindow(CREATESTRUCT& cs) 
{
static CString sClassName;
if ( sClassName.IsEmpty() )
{
sClassName = AfxRegisterWndClass( 0 );
} cs.hMenu = NULL;
cs.lpszClass = sClassName;
cs.style = WS_POPUP;
cs.dwExStyle |= WS_EX_TOOLWINDOW;

return CWnd::PreCreateWindow(cs);
}
void CNewWnd::SetBKColor(COLORREF clbk)
{
m_clBkColor = clbk;
this->Invalidate();
}
void CNewWnd::OnShowWindow(BOOL bShow, UINT nStatus) 
{
CWnd::OnShowWindow(bShow, nStatus);

SetForegroundWindow();
SetActiveWindow(); ShowCursor( m_bShowCursor );
}
void CNewWnd::OnPaint() 
{
CPaintDC dc(this);

RECT rc;
this->GetClientRect( &rc );
dc.FillSolidRect( &rc, m_clBkColor );
}我把OnPaint里面的代码注释掉也没有解决,很是郁闷:(