Well...depending on the operating system 'Sleep()' will sleep between 10 (Single CPU Windows NT) milliseconds and 50 milliseconds (Windows 98). I do not know of the top of my head whether Windows 2000 or XP have better resolution... Ciao, Andreas "Software is like sex, it's better when it's free." - Linus Torvalds
Andreas Masur
Posts
-
Problem with multi threading -
Moving Cursor position in Edit box !void CEdit::SetSel(DWORD dwSelection, BOOL bNoScroll = FALSE);
void CEdit::SetSel(int nStartChar, int nEndChar, BOOL bNoScroll = FALSE);To set the cursor at the end of the text within the control...
// With associated member variable to the edit control and to the content
UpdateData();
m_EditControl.SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());// With associated member variable to the content
UpdateData();
((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(m_EditContent.GetLength(), m_EditContent.GetLength());If you want to use the first function you have to set the starting position in the low-order word and and the ending position in the high-order word...thus
// With associated member variable to the edit control and to the content
UpdateData();// Set position
DWORD dwSelection = m_EditContent.GetLength();
dwSelection |= m_EditContent.GetLength() << 16;m_EditControl.SetSel(dwSelection);
// With associated member variable to the content
UpdateData();// Set position
DWORD dwSelection = m_EditContent.GetLength();
dwSelection |= m_EditContent.GetLength() << 16;((CEdit *) GetDlgItem(IDC_EDIT))->SetSel(dwSelection);
Ciao, Andreas "Software is like sex, it's better when it's free." - Linus Torvalds
-
Pop Dialog before startDo the following: CYourApp::InitInstance() { . . . // Call your first dialog FirstDialog::DoModal(); // Call your main dialog MainDialog::DoModal(); . . . } CFirstDialog::OnInitInstance() { // Do initialization stuff // Set timer SetTimer(1, 10000, NULL); return TRUE; } CFirstDialog::OnTimer(UINT nIDEvent) { if(nIDEvent == 1) { KillTimer(1); EndDialog(IDOK); } } This should display your splash screen for ten seconds before it loads the main dialog.