Appearing/Disappearing Asterisk in Title Bar
-
I am working on an MFC MDI application. I'd like to have the document title (in the app's title bar) display an asterisk at the end when the document has been changed. When the document is saved, the asterisk disappears. MS Visual Studio's text editor has this capability. Any suggestions on how to add this capability? Marc
-
I am working on an MFC MDI application. I'd like to have the document title (in the app's title bar) display an asterisk at the end when the document has been changed. When the document is saved, the asterisk disappears. MS Visual Studio's text editor has this capability. Any suggestions on how to add this capability? Marc
With AfxGetMainWnd you can get The main window Handle then you can use GetWindowText for read the Title and add a Asterisk when the docuement is changed using SetWindowText for write the new title. But Warning you can fill the Title with several asterisks, you need a control like a variable for this... Regards... Carlos Antollini. Sonork ID 100.10529 cantollini
-
I am working on an MFC MDI application. I'd like to have the document title (in the app's title bar) display an asterisk at the end when the document has been changed. When the document is saved, the asterisk disappears. MS Visual Studio's text editor has this capability. Any suggestions on how to add this capability? Marc
CDocument
provides some methods to maintain the "changed and unsaved" state, namelyIsModified
andSetModifiedFlag
. I guess the best solution is to overrideSetModifiedFlag
(assuming your app is using this method consistently) and change there the document's title accordingly usingSetTitle
. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo