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. Ownerdraw a Dialog

Ownerdraw a Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicsjsonquestion
5 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.
  • K Offline
    K Offline
    KellyR
    wrote on last edited by
    #1

    Hi all, I'm using VC++ with Windows API, no MFC. I want to create a dialog that is entirely owner-drawn, but I can't find a style to use with it (buttons being BS_OWNERDRAW, etc). Is there a style for owner-drawing entire dialogs or do I have to do this in some other way? Thanks!

    KR

    S 1 Reply Last reply
    0
    • K KellyR

      Hi all, I'm using VC++ with Windows API, no MFC. I want to create a dialog that is entirely owner-drawn, but I can't find a style to use with it (buttons being BS_OWNERDRAW, etc). Is there a style for owner-drawing entire dialogs or do I have to do this in some other way? Thanks!

      KR

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      Just register your own window class and run a message pump.

      Steve

      K 1 Reply Last reply
      0
      • S Stephen Hewitt

        Just register your own window class and run a message pump.

        Steve

        K Offline
        K Offline
        KellyR
        wrote on last edited by
        #3

        The dialog is created as a popup for my application which is already registered. I'm not sure how registering the dialog would help as it already has a message pump? Or maybe I don't understand what you mean? How can I use the dialog's message pump to custom draw the dialog? If I use WM_PAINT I can only draw in the client area of the dialog, right? If I set the dialog's border to "None" then I can basically draw the entire thing as long as I use a square bitmap... but I don't want it to be square, and if I draw the bitmap transparently I see the gray crap beneath it... isn't there a way I can just override the default drawing behavior of the dialog in the same way that I catch the WM_DRAWITEM message for my other custom controls? Thanks!

        KR

        S 1 Reply Last reply
        0
        • K KellyR

          The dialog is created as a popup for my application which is already registered. I'm not sure how registering the dialog would help as it already has a message pump? Or maybe I don't understand what you mean? How can I use the dialog's message pump to custom draw the dialog? If I use WM_PAINT I can only draw in the client area of the dialog, right? If I set the dialog's border to "None" then I can basically draw the entire thing as long as I use a square bitmap... but I don't want it to be square, and if I draw the bitmap transparently I see the gray crap beneath it... isn't there a way I can just override the default drawing behavior of the dialog in the same way that I catch the WM_DRAWITEM message for my other custom controls? Thanks!

          KR

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          What I'm saying is that if you want a dialog-like window that's totally user drawn then just make one: don't use the CreateDialog function and friends. If the dialog is to be modal all you have to do is disable it's parent and you may want to run a your own message pump.

          Steve

          K 1 Reply Last reply
          0
          • S Stephen Hewitt

            What I'm saying is that if you want a dialog-like window that's totally user drawn then just make one: don't use the CreateDialog function and friends. If the dialog is to be modal all you have to do is disable it's parent and you may want to run a your own message pump.

            Steve

            K Offline
            K Offline
            KellyR
            wrote on last edited by
            #5

            Oh ok, I get it. Thanks!

            KR

            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