ListView Control...

This is a discussion on ListView Control... within the Windows Programming forums, part of the Platform Specific Boards category; Where can I learn how to work with listview control (and I'm not talking about MSDN), without mfc, just plain ...

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    Question ListView Control...

    Where can I learn how to work with listview control (and I'm not talking about MSDN), without mfc, just plain API.

    Thanks.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,668
    Did somebody say MSDN?

    gg

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,230
    Or at least google. Not to sound like a complete jerk, but browsing about google with a few different key terms should revela any info you may need.

    Also, the above poster is correct. MSDN is your one-stop shopping spot for all of your API needs.

  4. #4
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    Well I did search at google, but it only finds mfc related places, but I need to write it in C with API.

    And I don't want to go to msdn right away, because it's too dry, too technical. So I want to read on this control first, from a tutorial, and only then go to the msdn.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,668
    Mmmm, if only more resources were dry and technical.....

    MSDN also has sample downloads.

    gg

  6. #6
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I just started using list views again. Here's some example code:

    Code:
    HWND hList;
    	
    hList=CreateWindowEx(WS_EX_CLIENTEDGE,WC_LISTVIEW,NULL,WS_CHILD|WS_VISIBLE | WS_BORDER | LVS_REPORT,0,0,300,300,hwnd,(HMENU)ID_LIST,GetModuleHandle(NULL),NULL);
    Note: include <commctrl32.h>, and link with comctl32.lib. Before you create the control, run InitCommonControls().

    Code:
    LV_COLUMN lvc;
    
    lvc.mask=LVCF_FMT | LVCF_TEXT | LVCF_WIDTH;
    lvc.fmt=LVCFMT_LEFT;
    lvc.cx=100;
    lvc.pszText="Privilege";
    
    SendMessage(hList,LVM_INSERTCOLUMN,0,(LPARAM)&lvc);
    
    //Insert sub item column
    lvc.mask=LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH;
    lvc.iSubItem=1;
    lvc.pszText="Attributes";
    lvc.cx=300;
    
    SendMessage(hList,LVM_INSERTCOLUMN,1,(LPARAM)&lvc);
    
    //Insert item
    LV_ITEM lvi;
    
    lvi.mask=LVIF_TEXT;
    lvi.iItem=0;
    lvi.iSubItem=0;
    lvi.iImage=0;
    lvi.pszText="Text";
    
    SendMessage(hList,LVM_INSERTITEM,NULL,(LPARAM)&lvi);
    
    //Insert sub-item
    lvi.mask=LVIF_TEXT;
    lvi.iItem=0;
    lvi.iSubItem=1;
    lvi.pszText="ATTRIBUTE";
    
    SendMessage(hList,LVM_SETITEM,NULL,(LPARAM)&lvi);
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  7. #7
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    Mmmm, if only more resources were dry and technical.....

    MSDN also has sample downloads.
    yes it does, but it's not what I'm looking for... I'm looking for a control that looks like a window with "details" (VIEW->DETAILS)


    That's why what bennyandthejets gave me is exactly what I need.



    Thanks a lot to everyone. I've been searching for this thing for quite a while, and finally got it.
    Last edited by Devil Panther; 07-12-2003 at 02:10 AM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  8. #8
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    Run a search here for 'listview'. Plenty of code for WIN32 C listviews.
    "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. Issue with ListView Control
    By elaverick in forum C# Programming
    Replies: 8
    Last Post: 04-29-2008, 03:42 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  3. A few questions on ListView Control...
    By Devil Panther in forum Windows Programming
    Replies: 0
    Last Post: 09-05-2003, 02:33 PM
  4. Edit control on listview
    By knutso in forum Windows Programming
    Replies: 5
    Last Post: 08-10-2003, 09:11 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM

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