Click here to Skip to main content
15,900,815 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: cstring library Pin
toxcct9-Jan-07 4:14
toxcct9-Jan-07 4:14 
GeneralRe: cstring library Pin
jhwurmbach9-Jan-07 4:20
jhwurmbach9-Jan-07 4:20 
GeneralRe: cstring library Pin
toxcct9-Jan-07 5:29
toxcct9-Jan-07 5:29 
GeneralRe: cstring library Pin
jhwurmbach9-Jan-07 5:52
jhwurmbach9-Jan-07 5:52 
QuestionIs there any matrix library in C++? Pin
Ming Luo9-Jan-07 1:57
Ming Luo9-Jan-07 1:57 
AnswerRe: Is there any matrix library in C++? Pin
CPallini9-Jan-07 2:33
mveCPallini9-Jan-07 2:33 
AnswerRe: Is there any matrix library in C++? Pin
Stephen Hewitt9-Jan-07 12:05
Stephen Hewitt9-Jan-07 12:05 
QuestionCDialog based window doesn't get focus. Pin
PatrykDabrowski9-Jan-07 1:19
PatrykDabrowski9-Jan-07 1:19 
I'm creating an additional window from my base CDialog application:

//m_dtarray[] keeps pointers

m_dtharray[i]=(CDialogThread*)AfxBeginThread(RUNTIME_CLASS(CDialogThread),THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
m_dtharray[i]->m_pt_winpos.x=x; //window pos
m_dtharray[i]->m_pt_winpos.y=y;
m_dtharray[i]->ResumeThread();

...and created window doesn't get focus. I tried to add something like this:
m_dtharray[i]->m_pMainWnd->SetFocus();
or
m_dtharray[i]->m_pMainWnd->SetForegroundWindow();

...but it doesn't help, still my window doesn't get focus (new window's name is blinking on taskbar). Window is created in OnInitInstance() in this way. (error checking skipped)

CTWindow *m_wnd=new CTWindow();
BOOL ret=m_wnd->Create(IDD_TWINDOW, NULL);
m_wnd->SetWindowPos(&CWnd::wndTopMost,m_pt_winpos.x,m_pt_winpos.y,0,0,SWP_NOSIZE);
m_wnd->ShowWindow(SW_SHOW);
// SetForegroundWindow(m_wnd->m_hWnd); //THIS DOESN'T HELP TOO....
// m_wnd->SetFocus(); //NEITHER THIS....
m_pMainWnd=(CWnd *)m_wnd;
m_wnd->m_ParentThread=this;

How can I set window focus?? (from main application or from newly created window, it doesnt matter)
Strange thing is, that when I run this code from VS2003 it's getting focus(?!?!) but when run from icon, it doesn't get...

Do You have any idea why??

Thanks for helpSmile | :)

Pat.
AnswerRe: CDialog based window doesn't get focus. Pin
S Douglas16-Jan-07 2:01
professionalS Douglas16-Jan-07 2:01 
AnswerRe: CDialog based window doesn't get focus - solution Pin
PatrykDabrowski16-Jan-07 2:35
PatrykDabrowski16-Jan-07 2:35 
Questioncolor histogram Pin
abichaz9-Jan-07 1:01
abichaz9-Jan-07 1:01 
AnswerRe: color histogram Pin
Chris Losinger9-Jan-07 4:55
professionalChris Losinger9-Jan-07 4:55 
GeneralRe: color histogram Pin
abichaz9-Jan-07 20:16
abichaz9-Jan-07 20:16 
GeneralRe: color histogram Pin
Chris Losinger10-Jan-07 1:28
professionalChris Losinger10-Jan-07 1:28 
GeneralRe: color histogram Pin
abichaz10-Jan-07 1:34
abichaz10-Jan-07 1:34 
QuestionProgram Logging Pin
karldwmoore9-Jan-07 0:57
karldwmoore9-Jan-07 0:57 
AnswerRe: Program Logging Pin
jhwurmbach9-Jan-07 3:04
jhwurmbach9-Jan-07 3:04 
GeneralRe: Program Logging Pin
karldwmoore9-Jan-07 3:15
karldwmoore9-Jan-07 3:15 
AnswerRe: Program Logging Pin
prasad_som9-Jan-07 3:18
prasad_som9-Jan-07 3:18 
GeneralRe: Program Logging Pin
jhwurmbach9-Jan-07 3:27
jhwurmbach9-Jan-07 3:27 
QuestionTree Control Pin
Sachinpatole9-Jan-07 0:20
Sachinpatole9-Jan-07 0:20 
AnswerRe: Tree Control Pin
Michael Dunn9-Jan-07 0:31
sitebuilderMichael Dunn9-Jan-07 0:31 
QuestionWhat is difference between OnPaint and OnDraw? Pin
Hemant kulkarni9-Jan-07 0:07
Hemant kulkarni9-Jan-07 0:07 
AnswerRe: What is difference between OnPaint and OnDraw? Pin
CPallini9-Jan-07 0:25
mveCPallini9-Jan-07 0:25 
AnswerRe: What is difference between OnPaint and OnDraw? Pin
Nothend9-Jan-07 0:44
Nothend9-Jan-07 0:44 

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.