Looking for advice/guidance on writting / painting to non Client area of window
-
Hi I have been trying to write to the non client area of a window specifically a Cdialog This CDialog has a Rich Edit (I am displaying storage obtained) and I am trying to give details about it in the Non client area seems to me there are 3 choices if I want to make it look nice nice means using the CDC class 1) process the ON_WM_NcPaint 2) using windows desktop manager (extending the frame and making it the client area) 3) using a static control / window was wondering if someone could guide on which path to take thanks
-
Hi I have been trying to write to the non client area of a window specifically a Cdialog This CDialog has a Rich Edit (I am displaying storage obtained) and I am trying to give details about it in the Non client area seems to me there are 3 choices if I want to make it look nice nice means using the CDC class 1) process the ON_WM_NcPaint 2) using windows desktop manager (extending the frame and making it the client area) 3) using a static control / window was wondering if someone could guide on which path to take thanks
ForNow wrote:
This CDialog has a Rich Edit (I am displaying storage obtained) and I am trying to give details about it in the Non client area
What kind of "details" are you gong to give in the dialog titlebar ("Non client area")? And why the simple SetWindowText call could not help you? Or did you mean some other area (not a titlebar - ?) to put your details?
-
Hi I have been trying to write to the non client area of a window specifically a Cdialog This CDialog has a Rich Edit (I am displaying storage obtained) and I am trying to give details about it in the Non client area seems to me there are 3 choices if I want to make it look nice nice means using the CDC class 1) process the ON_WM_NcPaint 2) using windows desktop manager (extending the frame and making it the client area) 3) using a static control / window was wondering if someone could guide on which path to take thanks
I did a quick searchereno using what we use, Lucene.net, and it's query syntax, and obtained: XFontDialog - Customizing CFontDialog Part I: Adding Font Filters[^] If you scroll down to the end of the page where the last image is perfunctorily displayed perhaps you'll see what I saw and think Is this what a non-client area customization looks like?
-
ForNow wrote:
This CDialog has a Rich Edit (I am displaying storage obtained) and I am trying to give details about it in the Non client area
What kind of "details" are you gong to give in the dialog titlebar ("Non client area")? And why the simple SetWindowText call could not help you? Or did you mean some other area (not a titlebar - ?) to put your details?
I am displaying MainFrame storage sent via TCP/IP sockets to Windows so the rich edit would display the actual storage The data in the NC frame of the dialog would be the storage subpool where the storage was obtained, the storage key, whether the storage fetch protect (non readable) owning tcb in z/os resources are owned by the task represented by a tcb control that have programs represented by RB (request blocks) as anside one of the things I learned that in windows that are only process and threads thanks
-
I did a quick searchereno using what we use, Lucene.net, and it's query syntax, and obtained: XFontDialog - Customizing CFontDialog Part I: Adding Font Filters[^] If you scroll down to the end of the page where the last image is perfunctorily displayed perhaps you'll see what I saw and think Is this what a non-client area customization looks like?
-
I am displaying MainFrame storage sent via TCP/IP sockets to Windows so the rich edit would display the actual storage The data in the NC frame of the dialog would be the storage subpool where the storage was obtained, the storage key, whether the storage fetch protect (non readable) owning tcb in z/os resources are owned by the task represented by a tcb control that have programs represented by RB (request blocks) as anside one of the things I learned that in windows that are only process and threads thanks
ForNow wrote:
I am displaying MainFrame storage sent via TCP/IP sockets to Windows so the rich edit would display the actual storage
In the context of your question it doesn't matter where the data you are going to display is coming form and how. :suss: however, you didn't answer why the simple SetWindowText cannot be used nor did you described the format of the data to be desplayed in NC area. :~
-
ForNow wrote:
I am displaying MainFrame storage sent via TCP/IP sockets to Windows so the rich edit would display the actual storage
In the context of your question it doesn't matter where the data you are going to display is coming form and how. :suss: however, you didn't answer why the simple SetWindowText cannot be used nor did you described the format of the data to be desplayed in NC area. :~
let me preface this by saying I am basically a mainfame programer so then I appreciate your expertise so here goes SetTextWindow gives me one line to fill out with no choice for color background color or font If I for instance use an ownerdraw static window my OnDrawitem could handle an rcItem Rect with possibly multiple lines allowing me to have my own font and color ?
-
let me preface this by saying I am basically a mainfame programer so then I appreciate your expertise so here goes SetTextWindow gives me one line to fill out with no choice for color background color or font If I for instance use an ownerdraw static window my OnDrawitem could handle an rcItem Rect with possibly multiple lines allowing me to have my own font and color ?
Then what does prevent you to implement some user defined control (derived from CStatic or, better, from CWnd), place it above or below your RichEdit and draw what you want using CDC class in this control? Just try it! Then if you wouldn't happy with such implementation then your next step were to move the code to the [OnNcPaint](https://docs.microsoft.com/en-us/cpp/mfc/reference/cwnd-class?view=msvc-170#onncpaint) handler.
-
Then what does prevent you to implement some user defined control (derived from CStatic or, better, from CWnd), place it above or below your RichEdit and draw what you want using CDC class in this control? Just try it! Then if you wouldn't happy with such implementation then your next step were to move the code to the [OnNcPaint](https://docs.microsoft.com/en-us/cpp/mfc/reference/cwnd-class?view=msvc-170#onncpaint) handler.
-
thanks BTW I spent hours and hours with NCPAINT is doesnt work after getting the right DC GetWindowDC did a Textout pos 1,1 and text was never displayed anyway thanks for your help much appreciate it