Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Looking for advice/guidance on writting / painting to non Client area of window

Looking for advice/guidance on writting / painting to non Client area of window

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
10 Posts 4 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    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

    V R 2 Replies Last reply
    0
    • F ForNow

      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

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      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?

      F 1 Reply Last reply
      0
      • F ForNow

        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

        R Offline
        R Offline
        RedDk
        wrote on last edited by
        #3

        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?

        F 1 Reply Last reply
        0
        • V Victor Nijegorodov

          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?

          F Offline
          F Offline
          ForNow
          wrote on last edited by
          #4

          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

          V 1 Reply Last reply
          0
          • R RedDk

            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?

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            thanks will look

            1 Reply Last reply
            0
            • F ForNow

              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

              V Offline
              V Offline
              Victor Nijegorodov
              wrote on last edited by
              #6

              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. :~

              F 1 Reply Last reply
              0
              • V Victor Nijegorodov

                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. :~

                F Offline
                F Offline
                ForNow
                wrote on last edited by
                #7

                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 ?

                V 1 Reply Last reply
                0
                • F ForNow

                  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 ?

                  V Offline
                  V Offline
                  Victor Nijegorodov
                  wrote on last edited by
                  #8

                  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.

                  F 1 Reply Last reply
                  0
                  • V Victor Nijegorodov

                    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.

                    F Offline
                    F Offline
                    ForNow
                    wrote on last edited by
                    #9

                    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

                    C 1 Reply Last reply
                    0
                    • F ForNow

                      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

                      C Offline
                      C Offline
                      charlieg
                      wrote on last edited by
                      #10

                      Make sure you are using the correct DC. Windows loves to clip stuff when drawing.

                      Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups