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. ATL / WTL / STL
  4. Flickering problem

Flickering problem

Scheduled Pinned Locked Moved ATL / WTL / STL
graphicshelp
5 Posts 3 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.
  • Q Offline
    Q Offline
    qur
    wrote on last edited by
    #1

    I am trying to develop the gird control in which Comboboxes are displayed over each subitem. In DrawItem event i am displaying the combobox for each subitem, which is i think cause the flickering problem. Anyone knows the solution to remove the flickering in this scenario. for(int nRow = 0; nRow < rows; ++ nRow) { for(int nCol = 0; cols; nCol++ ) { //Drawing combos by ShowWindow(SW_SHOW) call } }

    J 1 Reply Last reply
    0
    • Q qur

      I am trying to develop the gird control in which Comboboxes are displayed over each subitem. In DrawItem event i am displaying the combobox for each subitem, which is i think cause the flickering problem. Anyone knows the solution to remove the flickering in this scenario. for(int nRow = 0; nRow < rows; ++ nRow) { for(int nCol = 0; cols; nCol++ ) { //Drawing combos by ShowWindow(SW_SHOW) call } }

      J Offline
      J Offline
      Jason De Arte
      wrote on last edited by
      #2

      While I've never had to do what you're doing, two things come to mind 1. Queue up the display of multiple windows with DeferWindowPos() 2. In the parent, change the erase background code to create a region that exclude the area of the child windows - I neat trick for dealing with excessive flickering when resizing a dialog. I hope this helps [ Jason De Arte | Toy Maker | 1001010.com ]

      J 1 Reply Last reply
      0
      • J Jason De Arte

        While I've never had to do what you're doing, two things come to mind 1. Queue up the display of multiple windows with DeferWindowPos() 2. In the parent, change the erase background code to create a region that exclude the area of the child windows - I neat trick for dealing with excessive flickering when resizing a dialog. I hope this helps [ Jason De Arte | Toy Maker | 1001010.com ]

        J Offline
        J Offline
        Jorgen Sigvardsson
        wrote on last edited by
        #3

        Jason De Arte wrote: 2. In the parent, change the erase background code to create a region that exclude the area of the child windows - I neat trick for dealing with excessive flickering when resizing a dialog. Isn't WS_CLIPCHILDREN supposed to do this... :confused: I've a couple of dialogs which I want flicker free. WS_CLIPCHILDREN doesn't always help me. :| Say, you don't have a small dialog sample anywhere you'd like to show me, or better yet, write an article about it? :) -- Arigato gozaimashita!

        J 1 Reply Last reply
        0
        • J Jorgen Sigvardsson

          Jason De Arte wrote: 2. In the parent, change the erase background code to create a region that exclude the area of the child windows - I neat trick for dealing with excessive flickering when resizing a dialog. Isn't WS_CLIPCHILDREN supposed to do this... :confused: I've a couple of dialogs which I want flicker free. WS_CLIPCHILDREN doesn't always help me. :| Say, you don't have a small dialog sample anywhere you'd like to show me, or better yet, write an article about it? :) -- Arigato gozaimashita!

          J Offline
          J Offline
          Jason De Arte
          wrote on last edited by
          #4

          Jörgen Sigvardsson wrote: Say, you don't have a small dialog sample anywhere you'd like to show me, or better yet, write an article about it? When I have some time, I might write a small article - but it's realy easy to do for most controls (except group boxes) on your resizing dialog. 1. In your WM_ERASEBKGND handler... 2. Create a region of the client area 3. For each valid & visible child window you want to exclude, 3.a. create a region of that window (try GetWindowRgn, XP Themes tends to make buttons round) 3.b. remove the child region - CombineRgn(rgnChild,rgnDlg,RGN_XOR) 4. Paint your background, I use FillRgn 5. return TRUE from WM_ERASEBKGRND, or all your work will be undone. Minor details were left out, but you'll get the idea. [ Jason De Arte | Toy Maker | 1001010.com ]

          J 1 Reply Last reply
          0
          • J Jason De Arte

            Jörgen Sigvardsson wrote: Say, you don't have a small dialog sample anywhere you'd like to show me, or better yet, write an article about it? When I have some time, I might write a small article - but it's realy easy to do for most controls (except group boxes) on your resizing dialog. 1. In your WM_ERASEBKGND handler... 2. Create a region of the client area 3. For each valid & visible child window you want to exclude, 3.a. create a region of that window (try GetWindowRgn, XP Themes tends to make buttons round) 3.b. remove the child region - CombineRgn(rgnChild,rgnDlg,RGN_XOR) 4. Paint your background, I use FillRgn 5. return TRUE from WM_ERASEBKGRND, or all your work will be undone. Minor details were left out, but you'll get the idea. [ Jason De Arte | Toy Maker | 1001010.com ]

            J Offline
            J Offline
            Jorgen Sigvardsson
            wrote on last edited by
            #5

            I think I understand the idea. Now the question is; is this applicable for other controls than dialogs? I've had controls on resizable tab controls, and the flickering has been so bad. For this to work I need to be able to draw theme backgrounds using regions (tab controls have gradient backgrounds in XP). Seeing that the theme APIs don't make use of regions, I suppose I will have to give the HDC a clipping region. Do you know if that is possible? I'm guessing that selecting (SelectObject) a region will cause DC operations to be clipped by the region. (I'm really lost when it comes to advanced GDI :-O) -- Arigato gozaimashita!

            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