how to change title of a child dialog?
-
Chandrasekharanp wrote:
u can use SetWindowText().
You cannot use SMS language here, please. :)
It is a crappy thing, but it's life -^ Carlo Pallini
it is not working coz i will have to refer to child window first. how can i refer to child window? i hv implmented as: IRCNewSim* ptr1=NULL; Markcorr* ptr2=NULL; ptr1=(IRCNewSim*)AfxGetApp()->m_pMainWnd; ptr2=(Markcorr*)ptr1->GetActiveWindow(); ptr2->SetWindowText("Tower1 Scanner1"); thanks
-
u r -> sir, plz plz u don't blame... :-D It looks like the sms language is appreciated by the OP [^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]modified on Tuesday, December 2, 2008 4:39 AM
CPallini wrote:
It looks like the sms language is appreciated by the OP [^].
Indeed! I will never feel like answering these SMS questions. May be I'll send the reply via an SMS inztd. :laugh:
It is a crappy thing, but it's life -^ Carlo Pallini
-
it is not working coz i will have to refer to child window first. how can i refer to child window? i hv implmented as: IRCNewSim* ptr1=NULL; Markcorr* ptr2=NULL; ptr1=(IRCNewSim*)AfxGetApp()->m_pMainWnd; ptr2=(Markcorr*)ptr1->GetActiveWindow(); ptr2->SetWindowText("Tower1 Scanner1"); thanks
Waht was return value of SetWindowText?
-
Waht was return value of SetWindowText?
appl is getting crashed and control is going into Setwindowtext void CWnd::SetWindowText(LPCTSTR lpszString) { ASSERT(::IsWindow(m_hWnd)); if (m_pCtrlSite == NULL) ::SetWindowText(m_hWnd, lpszString); else m_pCtrlSite->SetWindowText(lpszString); } m_hwnd is showing as NULL
-
appl is getting crashed and control is going into Setwindowtext void CWnd::SetWindowText(LPCTSTR lpszString) { ASSERT(::IsWindow(m_hWnd)); if (m_pCtrlSite == NULL) ::SetWindowText(m_hWnd, lpszString); else m_pCtrlSite->SetWindowText(lpszString); } m_hwnd is showing as NULL
So I think your problem is of hwnd ptr2.
-
So I think your problem is of hwnd ptr2.
-
i have a dialog based appication. when i click on a button on a dialog(1st dialog), it will open 1 dialog(2nd dialog) and when i click on button on this dialog(2nd dialog) another dialog box(3rd dialog) will get opened and i want to change title of this dialog(3rd dialog). thanks in advance
Are you wanting to set the window text of the 3rd dialog dynamically? In that case, you could pass it as a parameter to the constructor of the 3rd dialog class and have a string member variable initialized with that value and then call
SetWindowText()
inInitDialog()
. That sounds viable?It is a crappy thing, but it's life -^ Carlo Pallini
-
ok... do u hv any other suggetion abt how can i implement this by some other method? or can u give me some demo of this type of application? i will b very much greatful to u
How did you create your child dialog?
-
i have a dialog based appication. when i click on a button on a dialog(1st dialog), it will open 1 dialog(2nd dialog) and when i click on button on this dialog(2nd dialog) another dialog box(3rd dialog) will get opened and i want to change title of this dialog(3rd dialog). thanks in advance
Anjali Patil wrote:
...i want to change title of this dialog(3rd dialog).
Call
SetWindowText()
from within itsOnInitDialog()
method."Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
That was not intentional
-
How did you create your child dialog?
-
Are you wanting to set the window text of the 3rd dialog dynamically? In that case, you could pass it as a parameter to the constructor of the 3rd dialog class and have a string member variable initialized with that value and then call
SetWindowText()
inInitDialog()
. That sounds viable?It is a crappy thing, but it's life -^ Carlo Pallini