Tree-view Won't Function!(HELP PLEASE!)

This is a discussion on Tree-view Won't Function!(HELP PLEASE!) within the Windows Programming forums, part of the Platform Specific Boards category; Everytime I create a Tree-view it shows up fine. I can put items in it very easily. When I add ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Tree-view Won't Function!(HELP PLEASE!)

    Everytime I create a Tree-view it shows up fine. I can put items in it very easily. When I add a WM_COMMAND message it stops working. No items are visible. What could be wrong?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User sean345's Avatar
    Join Date
    Mar 2002
    Posts
    346
    When something is added it sends a WM_COMMAND. So, when the WM_COMMAND is processed and zero is returned Windows thinks you added it manually. What you need to do is create another switch statement.

    Code:
    //Inside WndProc
    switch(msg){
    
    //More cases
    
    	case WM_COMMAND:
    		switch(HIWORD(wParam)){ //This is the notification message
                                                     //Put cases based on control
    			return 0;
    		}
                      default: return 1;
    //Finish switches
    If you do not process the msg then you need to return 1 else return 0. I think this will fix the problem you are having.

    - Sean
    If cities were built like software is built, the first woodpecker to come along would level civilization.
    Black Frog Studios

  3. #3
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    >>When something is added it sends a WM_COMMAND.

    My understanding is Treeviews return thru WM_NOTIFY not WM_COMMAND

    Hence the TVN_XXXX msg's (TreeView Notify)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Interpreter.c
    By moussa in forum C Programming
    Replies: 4
    Last Post: 05-28-2008, 06:59 PM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  3. Tree View control not appearing
    By Garfield in forum Windows Programming
    Replies: 1
    Last Post: 03-07-2004, 01:47 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 11:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21