HomeQuestions and AnswersArticlesSamplesLibrariesForumsNewsLinks

How to set the title text in the navigation bar?

By Yaroslav Goncharov, April 15, 2003.

Question

I use SetWindowText to set the dialog caption text. It works in the WM_INITDIALOG handler, but does not work in other handlers. How can I change the title text in the navigation bar?

Answer

SetWindowText works in the WM_INITDIALOG handler and in the main window; in other cases the navigation bar will not be refreshed. The Smartphone 2002 guidelines recommend to use context-sensitive titles, but the platform does not implement SHSetNavBarText function!

You can use the following code to update the dialog title:

SetWindowText(hDlg, TEXT("New Caption")); HWND hwndTray = FindWindow(TEXT("tray"), TEXT("tray")); PostMessage(hwndTray, WM_USER, 4, 0);

Discuss

Discuss this QA. Here you can write your comments and read comments of other developers.

  © 2002 Smartphone Developer Network | Want to be an author? | Contact Us