Is It Possible to do this?
-
I want to know if a dialog based program can be in the following style. 1. there is a title bar; 2. there is no caption on the title bar; 3. there is a caption on the windows task bar button. |-|3llo Wo|2ld
1. there is a title bar;
BOOL bHasTitleBar = this->GetStyle() & WS_CAPTION;
2. there is no caption on the title bar;
CString sCaption;
this->GetWIndowText(sCaption);
BOOL bHasCaptionOnTheTitleBar = sCaption.GetLength() > 0;3. there is a caption on the windows task bar button.
// Huh? If a window has caption on its title bar, then
// it also has the same caption on the system task bar button,
// if it does have a task bar button.
// If you mean "this window has a task bar button"
BOOL bHasTaskBarButton = (this->IsWindowVisible() && this == AfxGetMainWnd()); -
1. there is a title bar;
BOOL bHasTitleBar = this->GetStyle() & WS_CAPTION;
2. there is no caption on the title bar;
CString sCaption;
this->GetWIndowText(sCaption);
BOOL bHasCaptionOnTheTitleBar = sCaption.GetLength() > 0;3. there is a caption on the windows task bar button.
// Huh? If a window has caption on its title bar, then
// it also has the same caption on the system task bar button,
// if it does have a task bar button.
// If you mean "this window has a task bar button"
BOOL bHasTaskBarButton = (this->IsWindowVisible() && this == AfxGetMainWnd());=[ Abin ]= wrote: // Huh? If a window has caption on its title bar, then // it also has the same caption on the system task bar button, // if it does have a task bar button. // If you mean "this window has a task bar button" I mean this window has a task bar button with caption as well as a title bar without caption. The requirements are quite strange and make me hard to implement. I am now considering if i can set the caption color to transparent or to the same of the title bar. Do you have any idea? Thanks very much |-|3llo Wo|2ld
-
I want to know if a dialog based program can be in the following style. 1. there is a title bar; 2. there is no caption on the title bar; 3. there is a caption on the windows task bar button. |-|3llo Wo|2ld
Requirements 2 & 3 collide. As you already know... But you can cheat. Set a title as you normally would. Then handle the
WM_NCPAINT
message and draw the title bar yourself (and don''t bother drawing the text!). For examples of custom title bars, search codeproject forWM_NCPAINT
andOnNcPaint
. And I agree, it is a strange request! Iain.