Drawing a Window Frame
-
Hi there, Basically I have several modeless dialog boxes which need to have their title bars customly painted. This is due to the fact that I can't let the windows look inactive -- they must all appear to the user to be simultaneously active. Anyway, because I couldn't find a better solution to solve this (OnNcActivate seems to block messages from reaching the main frame window for some reason...), I was wondering if someone knows of an API method (or an example) which could allow me to draw the title bar (and perhaps the window frame if needsbe)? Something similar to
DrawFrameControl
, but for the window frame itself? Thank you, David -
Hi there, Basically I have several modeless dialog boxes which need to have their title bars customly painted. This is due to the fact that I can't let the windows look inactive -- they must all appear to the user to be simultaneously active. Anyway, because I couldn't find a better solution to solve this (OnNcActivate seems to block messages from reaching the main frame window for some reason...), I was wondering if someone knows of an API method (or an example) which could allow me to draw the title bar (and perhaps the window frame if needsbe)? Something similar to
DrawFrameControl
, but for the window frame itself? Thank you, Davidif i had to do this, i would fake the titlebar. i would construct the dialogbox without a title and paint the title myself. you can construct the buttons also then: m_dialog1->writeMyTitel("Title 1"); m_dialog2->writeMyTitel("Title 2");
-
if i had to do this, i would fake the titlebar. i would construct the dialogbox without a title and paint the title myself. you can construct the buttons also then: m_dialog1->writeMyTitel("Title 1"); m_dialog2->writeMyTitel("Title 2");
Hi, thanks for the reply. GermanGeorge wrote: i would construct the dialogbox without a title and paint m_dialog1->writeMyTitel("Title 1"); Yeah, I understand, but is there any GDI method I could use to draw the window title? Something similar to
DrawFrameControl
which would make the window title look according to the user's installed Windows OS style? [I mean, under Windows '95 the windows look differently than they do in Windows XP] Cheers, David -
Hi, thanks for the reply. GermanGeorge wrote: i would construct the dialogbox without a title and paint m_dialog1->writeMyTitel("Title 1"); Yeah, I understand, but is there any GDI method I could use to draw the window title? Something similar to
DrawFrameControl
which would make the window title look according to the user's installed Windows OS style? [I mean, under Windows '95 the windows look differently than they do in Windows XP] Cheers, Davidyou are right. but, i found a solution to your problme (hopefully) it works fine here. in the header of the modeless dialog declare:
afx_msg BOOL OnNcActivate( BOOL bActive );
In the MassageMap of the dialog declareON_WM_NCACTIVATE()
add a method:BOOL Dialog1::OnNcActivate (BOOL bActive) { return TRUE; }
that's it.