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. Drawing a Window Frame

Drawing a Window Frame

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsjsontutorialquestion
4 Posts 2 Posters 0 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.
  • 0 Offline
    0 Offline
    0v3rloader
    wrote on last edited by
    #1

    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

    G 1 Reply Last reply
    0
    • 0 0v3rloader

      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

      G Offline
      G Offline
      GermanGeorge
      wrote on last edited by
      #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");

      0 1 Reply Last reply
      0
      • G GermanGeorge

        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");

        0 Offline
        0 Offline
        0v3rloader
        wrote on last edited by
        #3

        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

        G 1 Reply Last reply
        0
        • 0 0v3rloader

          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

          G Offline
          G Offline
          GermanGeorge
          wrote on last edited by
          #4

          you 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 declare ON_WM_NCACTIVATE() add a method: BOOL Dialog1::OnNcActivate (BOOL bActive) { return TRUE; } that's it.

          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