1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hi friends

Discussion in 'Meet and Greet' started by rachappa, Sep 14, 2006.

  1. rachappa

    rachappa New Member

    Joined:
    Sep 14, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    I am Rachappa Bandi,
    I am a programmer in VC++ from 6 months.
    Can Anyone help me for creating the Treeview for Registry without MFC.
    waiting for reply..

    With Regards
    Rachappa Bandi.. :)
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    Welcome to G4EF.
    You need to be using the Win32 then.
     
  3. rachappa

    rachappa New Member

    Joined:
    Sep 14, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Hi, shabbir
    I am using DEV C++ Compiler its GPL Compiler. This compiler won't support for mfc functions. so i need to write the treeview in C or C++. I am able to read the registry keys . I am struck at 3rd iteration of treeview to show the keys.., help me..
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    What API you are using to read the Registry Keys.

    Probably to show the Keys you need to be using the ListView or the ListCtrl
     
  5. rachappa

    rachappa New Member

    Joined:
    Sep 14, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Ya I am using API's from the SDK. like RegOpenKeyEx, RegQueryInfoKey, But Displaying keys in the treeview is failing.. how to handle the treectrl I am new to this one..
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    you create such controls by calling CreateWindow[Ex]() to specify their size, position, class name, styles,etc as required. For example, if you want the user to be able to tab to the window, you give it the WS_TABSTOP style (presuming the code already exists to handle the tab key). SetWindowPos() can be used to show or hide the window as well as change its position in the Z-order relative to its siblings (the other controls) living in the client area of the same window.

    Now to adding a tree node and subnode use
    Code:
    HTREEITEM ht = treeCtrl.InsertItem("Shabbir",0,0);
    treeCtrl.InsertItem("Shabbir",ht);
    
    Remember to expand the added node to see the node.
     

Share This Page