How to update windows title bar dynamically?
Answers were Sorted based on User's Feedback
Answer / vasanth
using SetWindowText()function we can change text of
specified window dynamically
| Is This Answer Correct ? | 13 Yes | 5 No |
Answer / muralee krishnan n
After updating the window text using SetWindowText funcion,
we have to call RedrawWindow funcion.
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / vivek chauhan
** using SetWindowText()function in dialog.
** using settitle() function in property sheet dialog.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / anup
If title bar of window needs to be changed dynamically, SetWindowText() will do the job, or use SendMessage() and send message WM_SETTEXT to the particular window
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / debarun biswas
Use CWnd::SetWindowTextW(name of the Dialog);
"name of the dialog" should CString type.
for ex: CWnd::SetWindowTextW(_T("My Dialog"))
| Is This Answer Correct ? | 0 Yes | 0 No |
Ex1:-
BOOL CSample1_button_name_changingDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetWindowText(L"Changing the Caption of Dialogbox at Runtime");
return TRUE; // return TRUE unless you set the focus to a control
}
Ex2:-
BOOL CSample1_button_name_changingDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetWindowTextW(L"Changing the Caption of Dialogbox at Runtime");
return TRUE; // return TRUE unless you set the focus to a control
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / me
get the object of CMainfrm class and call the SetWindowText
function to chage the title of the window.
| Is This Answer Correct ? | 0 Yes | 1 No |
What is the difference between GetMessage and PeekMessage ?
What is the difference between workrer thread and UI thread
What view class enables you to use an edit control as a view?
What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?
What function is used to disable a control at runtime?
If application hangs while SendMessage is waiting for the result, how you handle it?
What is LPCTSTR? What does LP denote it?
how does conditionally close the Dialog Box ?
What is model and modeless dialog box ? Give some examples?
What is the difference between the Encapsulation and Abstraction
25 Answers HCL, Invensys, TCS, Wipro,
what is functioning of DIalodDataXchange ..?
List out the parameters of WinMain Function.