SysListView32

This is a discussion on SysListView32 within the Windows Programming forums, part of the Platform Specific Boards category; Hi to all, I created a list view window using Code: ListView = CreateWindowEx(WS_EX_CLIENTEDGE, "SysListView32", NULL, WS_CHILD | WS_VISIBLE | ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    22

    SysListView32

    Hi to all,

    I created a list view window using
    Code:
    ListView = CreateWindowEx(WS_EX_CLIENTEDGE, "SysListView32", NULL, WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL,
    rc.left+156, rc.top+INIT, 474, rc.bottom-40, hwnd, (HMENU)LISTVIEW32, GetModuleHandle(NULL), NULL);
    SendMessage(ListView, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
    InitListView(ListView);
    Now InitListView seems not to draw the column headers i.e

    Code:
    void InitListView(HWND hwndLV)
    {
    	LV_COLUMN lvc;
    	SendMessage(hwndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
    
    	memset(&lvc, 0, sizeof(LV_COLUMN) );
    	lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
    	lvc.fmt = LVCFMT_LEFT;
    
    	// first column
    	int ColWidth = (INT) 90;
    	lvc.iSubItem   = 0;
    	lvc.cx         = ColWidth;
    	lvc.cchTextMax = 13;
    	lvc.pszText    = "Computer Name";
    	ListView_InsertColumn(hwndLV, 0, &lvc);
    
    	// second column
    	ColWidth = (INT) 100;
    	lvc.iSubItem   = 1;
    	lvc.cx         = ColWidth;
    	lvc.cchTextMax = 10;
    	lvc.pszText    = "IP Address";
    	ListView_InsertColumn(hwndLV, 1, &lvc);
    }
    The window turns up quite empty. Any Ideas?

    Thanks alot
    -------------------------
    Gerald.

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    223
    I could not tell from your code as I mostly use the MFC....
    but did you set the report style for your control?
    LVS_REPORT
    zMan

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    22

    Thanks alot zMan

    Well I never, I hadn't set LVS_REPORT in my CreateWindowEx statement.

    thanks, works fine now
    -------------------------
    Gerald.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. EnumChildWindows and a SysListView32
    By pobri19 in forum Windows Programming
    Replies: 3
    Last Post: 02-02-2009, 06:40 AM

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