Thread: Dynamic window contents

  1. #1
    Registered Abuser
    Join Date
    Jun 2006

    Dynamic window contents

    I am trying to implement a very common interface theme such as a properties sheet, where you have a "category list" that allows the user to pick from certain categories, each category showing its own list of controls. Essentially, what I need to do is clear the window of all controls and only show the controls pertinent to the current category selected. What I've implemented so far is in an EnumChildWindowProc that goes through all child windows and disables and hides them if they are not pertinent to the current category. However, there are some controls (particularly all my comboBoxEx's) that do not seem to like being hidden via ShowWindow(SW_HIDE), and do not display properly when I try to reshow them, plus manually iterating through every window seems a bit cumbersome and I thought there might be a better way (i.e. like the properties sheet control). I would have actually just used a properties sheet control, but I wanted a more customized approach, using a TreeView for category browsing instead of tabs.
    So my question is really twofold:
    1) Am I approaching this with the right solution (i.e. EnumWindows/show & hide)?
    2) If so, why are some controls become corrupted after hiding and reshowing them, is there another function I should be using to disable and hide controls?

    Thanks for any suggestions!

    On a whim, I played around with the CBEM_GETCOMBO/EDITCONTROL message, and seemed to solve problem 2 by explicitly re-enabling the comboboxex's children controls (Since disabling and hiding a window implicitly disables and hides its children, I would've have figured it logical to have it behave the same way while re-enabling them... but I guess thats winapi for ya !)
    Last edited by @nthony; 01-22-2007 at 01:16 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C or C++
    By AcerN30 in forum Game Programming
    Replies: 41
    Last Post: 05-30-2008, 06:57 PM
  2. Adding buttons, edit boxes, etc to the window
    By rainmanddw in forum Windows Programming
    Replies: 1
    Last Post: 04-10-2006, 03:07 PM
  3. Fixed window size
    By The Brain in forum Windows Programming
    Replies: 5
    Last Post: 02-23-2006, 03:07 PM
  4. Replies: 1
    Last Post: 03-03-2004, 10:35 AM
  5. Problem with creating new window, from another window
    By Garfield in forum Windows Programming
    Replies: 6
    Last Post: 01-11-2004, 02:10 PM