Change Titletext of an SDI App at the very beginning
-
I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you
-
I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you
To change the Window title you must use the SetWindowText() function as folows: 1- Override the function PreTranslateMessage() in the MainFrame Class 2- Write the SetWindowText() function here. Regards, Rizwan Majeed.
-
To change the Window title you must use the SetWindowText() function as folows: 1- Override the function PreTranslateMessage() in the MainFrame Class 2- Write the SetWindowText() function here. Regards, Rizwan Majeed.
-
I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you
Hi DiDi, I haven't done this myself, but I have done this with Dialog Based apps, so I am making some assumptions here. In your SDI, in the View class, there is a function OnInitialUpdate(). This function is called after the window is 'created' but before it is actually displayed on the screen. In order to set the window text, the window must exist. But, I understand that you want to set the text before the window becomes visible. The aforementioned function is the perfect place to put such code. In your View class, override OnInitialUpdate(), call the base class CView::OnInitialUpdate(), and then add your code to change the name of your window before this function finishes. Hope this helps Jeff
-
I want to change the TitleText of the MainFrame (SDI) at the initialization time of my app. I dont want to have this Text in the Form (Document - Application). I can use SetWindowText to do this later (after Initialization) but I didnt found out where I have to put it when I want to change the Text to appear while starting. Where should I put my code? What function should I use Thank you
-
To change the Window title you must use the SetWindowText() function as folows: 1- Override the function PreTranslateMessage() in the MainFrame Class 2- Write the SetWindowText() function here. Regards, Rizwan Majeed.
That's a little extreme. All you need do is remove the FWS_ADDTOTITLE style from the window and then change the IDR_MAINFAME string to say whatever you like.