Click here to Skip to main content
15,897,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: visual C++ expert...need help!! Pin
Richard MacCutchan8-Sep-09 23:03
mveRichard MacCutchan8-Sep-09 23:03 
QuestionTerminating Process [modified] Pin
gothic_coder6-Sep-09 21:42
gothic_coder6-Sep-09 21:42 
AnswerRe: Terminating Process Pin
Richard MacCutchan7-Sep-09 2:26
mveRichard MacCutchan7-Sep-09 2:26 
GeneralRe: Terminating Process Pin
gothic_coder7-Sep-09 2:46
gothic_coder7-Sep-09 2:46 
GeneralRe: Terminating Process Pin
kilt7-Sep-09 4:58
kilt7-Sep-09 4:58 
GeneralRe: Terminating Process Pin
Richard MacCutchan7-Sep-09 5:02
mveRichard MacCutchan7-Sep-09 5:02 
GeneralRe: Terminating Process Pin
David Crow14-Sep-09 3:56
David Crow14-Sep-09 3:56 
QuestionHow can set focus in Main window in SDI? Pin
Le@rner6-Sep-09 21:30
Le@rner6-Sep-09 21:30 
Hi all,

i m using SDI application,

i m using worker thread for loading records in ListControl.

here i m using a modeless dialog box ,i create and display the modeless dialog before Starting the thread and hide it at end of thread.

I m start thread at OnInitialUpdate function of Formview.

my problem is that when modelss dialog box hide now the main window lost the focus.

i m use SetFocus function but its not working.

// m_pmodeless modeless dialog box
void CFormView::OnInitialUpdate()
{
	CMainFrame *pMainFrame=(CMainFrame*)AfxGetMainWnd();
	if(Main_View->m_pmodeless)
	{
		m_pmodeless->SetForegroundWindow();
		m_pmodeless->ShowWindow(SW_SHOW);
		pMainFrame->EnableWindow(0);
		m_pmodeless->EnableWindow(0);
	}
	else
	{
		m_pmodeless = new CModeless_dlg
		m_pmodeless->Create(CModeless_dlg::IDD,0);
		m_pmodeless->ShowWindow(SW_SHOW);
		pMainFrame->EnableWindow(0);
		m_pmodeless->EnableWindow(0);
	}
	//------------------------Start thread---------------------------------------//
	AfxBeginThread(Initial_Thread,NULL,THREAD_PRIORITY_HIGHEST,0,0,NULL);
}

//and at end of thread
	m_pmodeless->ShowWindow(SW_HIDE);
	CMainFrame *pMainFrame=(CMainFrame*)AfxGetMainWnd();
	pMainFrame->EnableWindow(1);
	pMainFrame->SetFocus();

please tell me how can i setfocus on main window of sdi.

thanks in advance.

To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.

AnswerRe: How can set focus in Main window in SDI? Pin
Stuart Dootson6-Sep-09 22:01
professionalStuart Dootson6-Sep-09 22:01 
Questionconst TCHAR* to TCHAR* Pin
Nandu_77b6-Sep-09 21:02
Nandu_77b6-Sep-09 21:02 
AnswerRe: const TCHAR* to TCHAR* Pin
CPallini6-Sep-09 21:10
mveCPallini6-Sep-09 21:10 
AnswerRe: const TCHAR* to TCHAR* Pin
Stuart Dootson6-Sep-09 21:53
professionalStuart Dootson6-Sep-09 21:53 
GeneralRe: const TCHAR* to TCHAR* Pin
Nandu_77b7-Sep-09 1:58
Nandu_77b7-Sep-09 1:58 
QuestionDisplay Strings Pin
Nick_1116-Sep-09 20:28
Nick_1116-Sep-09 20:28 
AnswerRe: Display Strings Pin
Stuart Dootson6-Sep-09 21:50
professionalStuart Dootson6-Sep-09 21:50 
GeneralRe: Display Strings Pin
Nick_1116-Sep-09 22:56
Nick_1116-Sep-09 22:56 
GeneralRe: Display Strings Pin
Stuart Dootson6-Sep-09 23:07
professionalStuart Dootson6-Sep-09 23:07 
GeneralRe: Display Strings Pin
Nick_1116-Sep-09 23:51
Nick_1116-Sep-09 23:51 
GeneralRe: Display Strings Pin
Stuart Dootson6-Sep-09 23:59
professionalStuart Dootson6-Sep-09 23:59 
GeneralRe: Display Strings Pin
choramale_vs7-Sep-09 0:03
choramale_vs7-Sep-09 0:03 
GeneralRe: Display Strings Pin
Stuart Dootson7-Sep-09 0:14
professionalStuart Dootson7-Sep-09 0:14 
GeneralRe: Display Strings Pin
choramale_vs7-Sep-09 0:41
choramale_vs7-Sep-09 0:41 
GeneralRe: Display Strings Pin
Stuart Dootson7-Sep-09 2:35
professionalStuart Dootson7-Sep-09 2:35 
QuestionNon Blocking message Box Pin
trioum6-Sep-09 20:18
trioum6-Sep-09 20:18 
AnswerRe: Non Blocking message Box Pin
Stuart Dootson6-Sep-09 20:23
professionalStuart Dootson6-Sep-09 20:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.