怎样显示LOGO?
为了在软件打开时先出现一个LOGO,过几秒种后,再弹出对话框
我开了个线程,请问Sleep后,怎样回到主对话框?
我有一个用单文档做的例子
在Dialog 的App怎样实现呢?
代码如下:
BOOL CChatCntApp::InitInstance()
{
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
LoadStdProfileSettings();
//ADDITION OF SPLASH SCREEN COMPONENT
//Bring up the splash screen in a secondary UI thread
CSplashThread* pSplashThread = (CSplashThread*) AfxBeginThread(RUNTIME_CLASS(CSplashThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
if (pSplashThread == NULL)
{
AfxMessageBox(_T("Failed to create splash screen"), 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.
//Alternatively, you could use the line:
// pSplashThread->SetBitmapToUse(GetHomeDirectory() + _T("TEST.BMP"));
//if you wanted the splasher code to load a bitmap from file at runtime.
pSplashThread->SetBitmapToUse(IDB_SPLASH);
pSplashThread->ResumeThread(); //Resume the thread now that we have set it up
Sleep(3000); //Simulate some slow loading process. Your code might
//load up some info from a file or make a network connection etc.
pSplashThread->HideSplash(); //Bring down the splash screen
CDialog* pDlg;
pDlg = new CDialog(
IDR_MAINFRAME,
RUNTIME_CLASS(CChatCntDlg),
RUNTIME_CLASS(CntSocket),
RUNTIME_CLASS(CCEnBitmap),
RUNTIME_CALSS(CPlaySoundThread),
RUNTIME_CALSS(CRecordSoundThread),
RUNTIME_CALSS(CTransparentStatic));
AddDialog(pDlg);
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//ADDITION OF SPLASH SCREEN COMPONENT
//This is required to activate the normal mainframe, If you remove the splash
//screen, then the main frame window is brought up but will not
//be at the top of the Z Order.
m_pMainWnd->SetForegroundWindow();
return TRUE;
}
CString CChatCntApp::GetHomeDirectory()
{
TCHAR sFilename[_MAX_PATH];
TCHAR sDrive[_MAX_DRIVE];
TCHAR sDir[_MAX_DIR];
TCHAR sFname[_MAX_FNAME];
TCHAR sExt[_MAX_EXT];
GetModuleFileName(AfxGetInstanceHandle(), sFilename, _MAX_PATH);
_tsplitpath(sFilename, sDrive, sDir, sFname, sExt);
CString rVal(CString(sDrive) + CString(sDir));
int nLen = rVal.GetLength();
if (rVal.GetAt(nLen-1) != _T('\\'))
rVal += _T("\\");
return rVal;
}
上面RUNTIME_CLASS的地方是错的.请问在对话框中怎么实现?
我开了个线程,请问Sleep后,怎样回到主对话框?
我有一个用单文档做的例子
在Dialog 的App怎样实现呢?
代码如下:
BOOL CChatCntApp::InitInstance()
{
#ifdef _AFXDLL
Enable3dControls();
#else
Enable3dControlsStatic();
#endif
LoadStdProfileSettings();
//ADDITION OF SPLASH SCREEN COMPONENT
//Bring up the splash screen in a secondary UI thread
CSplashThread* pSplashThread = (CSplashThread*) AfxBeginThread(RUNTIME_CLASS(CSplashThread), THREAD_PRIORITY_NORMAL, 0, CREATE_SUSPENDED);
if (pSplashThread == NULL)
{
AfxMessageBox(_T("Failed to create splash screen"), 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.
//Alternatively, you could use the line:
// pSplashThread->SetBitmapToUse(GetHomeDirectory() + _T("TEST.BMP"));
//if you wanted the splasher code to load a bitmap from file at runtime.
pSplashThread->SetBitmapToUse(IDB_SPLASH);
pSplashThread->ResumeThread(); //Resume the thread now that we have set it up
Sleep(3000); //Simulate some slow loading process. Your code might
//load up some info from a file or make a network connection etc.
pSplashThread->HideSplash(); //Bring down the splash screen
CDialog* pDlg;
pDlg = new CDialog(
IDR_MAINFRAME,
RUNTIME_CLASS(CChatCntDlg),
RUNTIME_CLASS(CntSocket),
RUNTIME_CLASS(CCEnBitmap),
RUNTIME_CALSS(CPlaySoundThread),
RUNTIME_CALSS(CRecordSoundThread),
RUNTIME_CALSS(CTransparentStatic));
AddDialog(pDlg);
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo))
return FALSE;
//ADDITION OF SPLASH SCREEN COMPONENT
//This is required to activate the normal mainframe, If you remove the splash
//screen, then the main frame window is brought up but will not
//be at the top of the Z Order.
m_pMainWnd->SetForegroundWindow();
return TRUE;
}
CString CChatCntApp::GetHomeDirectory()
{
TCHAR sFilename[_MAX_PATH];
TCHAR sDrive[_MAX_DRIVE];
TCHAR sDir[_MAX_DIR];
TCHAR sFname[_MAX_FNAME];
TCHAR sExt[_MAX_EXT];
GetModuleFileName(AfxGetInstanceHandle(), sFilename, _MAX_PATH);
_tsplitpath(sFilename, sDrive, sDir, sFname, sExt);
CString rVal(CString(sDrive) + CString(sDir));
int nLen = rVal.GetLength();
if (rVal.GetAt(nLen-1) != _T('\\'))
rVal += _T("\\");
return rVal;
}
上面RUNTIME_CLASS的地方是错的.请问在对话框中怎么实现?
...全文
相关推荐
Google 谷歌内页logo的呈现方式(图片下面有文字)
Google 谷歌内页logo的呈现方式(图片下面有文字) ,值得学习下。
Codility每周一课:P3.2 PermMissingElem
P3.2 PermMissingElem Find the missing element in a given permutation. P3.2 缺失的元素 寻找数组中缺失的唯一元素 数组A是由1到N+1中的N个不同的整数组成的,这意味着只缺少一个元素。目标是找到缺失的元素。 编写函数: def solution(A) 给定数组A,则返回缺少元素的值。 例如,给定数组:A[0]=2,A...
HTML如何给自己制作的网站配上个logo标志.zip
HTML如何给自己制作的网站配上个logo标志.zip
Logo命令大全.pdf
Logo命令大全.pdf
EBS R12更改界面LOGO
EBS R12更改界面LOGO


界面
