程序启动前,先启动一个界面,我想让鼠标变成沙漏,可死活不行,请指点
代码如下:
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()也试过,也不行,为什么会这样
我刚入江湖,请前辈指点!
代码如下:
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()也试过,也不行,为什么会这样
我刚入江湖,请前辈指点!
不知楼主是何原因。
::SetCursor(AfxGetApp()->LoadCursor(IDC_WAIT));
就ok了吧?