程序启动前,先启动一个界面,我想让鼠标变成沙漏,可死活不行,请指点
代码如下:
         HCURSOR hCursor = NULL;
hCursor = SetCursor(::LoadCursor(NULL,IDC_WAIT));
   
AfxGetApp()->WriteProfileString("Center1","Content","中心");

AfxGetApp()->WriteProfileString("chuankou","Content","串口配置"); //实现程序片头
CSplashThread* pSplashThread = (CSplashThread*) AfxBeginThread(RUNTIME_CLASS(CSplashThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
if (pSplashThread == NULL)
{
AfxMessageBox(_T("Wrong Create Splash Window"), MB_OK | MB_ICONSTOP);
return FALSE;
}

ASSERT(pSplashThread->IsKindOf(RUNTIME_CLASS(CSplashThread))); //Tell the splash screen to load the bitmap from a resource called   IDB_SPLASH.
// pSplashThread->SetBitmapToUse(GetHomeDirectory() + _T("TEST.BMP")); 
pSplashThread->SetBitmapToUse(IDB_SPLASH);
  
pSplashThread->ResumeThread();
    Sleep(2000);
   
pSplashThread->HideSplash();
    
SetCursor(hCursor);
注明:我用BeginWaitCursor() 和 EndWaitCursor()也试过,也不行,为什么会这样
我刚入江湖,请前辈指点!

解决方案 »

  1.   

    以前用BeginWaitCursor,行。
    不知楼主是何原因。
      

  2.   

    请把 LoadCursor 第一个参数改为 Splash Window 的 HINSTANCE
      

  3.   

    LoadCursor(NULL,IDC_WAIT)光标资源在用LoadCursor载入的时候第1个参数不能为NULL,而应该是当前出口的句柄,NULL只限系统定义的光标资源使用
      

  4.   


    ::SetCursor(AfxGetApp()->LoadCursor(IDC_WAIT));
      

  5.   

    咳~~~在显示封面的时候加一句CWaitCursor csr;
    就ok了吧?