Click here to Skip to main content
15,884,537 members
Articles / Desktop Programming / MFC

Using ListView control under Win32 API

Rate me:
Please Sign up or sign in to vote.
4.87/5 (141 votes)
2 Aug 2003CPOL10 min read 987K   19.5K   191  
This article will show/teach how to use ListView under Win32 API (Visual C++ 6.0).
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE MOVEABLE PURE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE MOVEABLE PURE 
BEGIN
    "#include ""afxres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE MOVEABLE PURE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDC_DIALOG DIALOGEX 0, 0, 426, 142
STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Win32 ListView Control Example By Bengi - 2003"
MENU IDR_MENU1
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "List1",IDC_LIST,"SysListView32",LVS_REPORT | 
                    LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,2,10,271,116
    GROUPBOX        "",IDC_STATIC,284,6,135,120
    PUSHBUTTON      "Delete Selected Item (row)",IDC_DELSELITEM,301,23,103,
                    17,0,WS_EX_STATICEDGE
    PUSHBUTTON      "Delete All Items (rows)",IDC_DELALL,301,43,103,16,0,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ADD,290,88,53,12,ES_AUTOHSCROLL | NOT WS_BORDER,
                    WS_EX_STATICEDGE
    EDITTEXT        IDC_ADDSUB,360,88,53,12,ES_AUTOHSCROLL | NOT WS_BORDER,
                    WS_EX_STATICEDGE
    PUSHBUTTON      "Add item",IDC_ADDITEM,290,105,44,15,0,WS_EX_STATICEDGE
    PUSHBUTTON      "Add SubItem",IDC_ADDSUBITEM,363,106,51,15,0,
                    WS_EX_STATICEDGE
    PUSHBUTTON      "+",IDC_BOTH,341,107,15,12,0,WS_EX_STATICEDGE
END


/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//

#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE 
BEGIN
    IDC_DIALOG, DIALOG
    BEGIN
        BOTTOMMARGIN, 141
    END
END
#endif    // APSTUDIO_INVOKED

#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
// Unknown language: 0xD, 0x1 resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_HEB)
#ifdef _WIN32
LANGUAGE 0xD, 0x1
#pragma code_page(1255)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1               ICON    DISCARDABLE     "icon1.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDR_MENU1 MENU DISCARDABLE 
BEGIN
    POPUP "Options"
    BEGIN
        MENUITEM "Rename Selected",             IDC_RENAME
        MENUITEM "Select All",                  IDC_SELECT_ALL
        MENUITEM "Goto Last item...",           IDC_LAST_ITEM
    END
END

#endif    // Unknown language: 0xD, 0x1 resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Israel Israel
Win32API Rocks your world!!

Comments and Discussions