home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
PL_Help.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
2KB
|
65 lines
/* PL_Help - March 26th, 2001
**
** Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
**
** This module contains functions to facilitate simple ListView
** data access.
**
** Called: list = handle to the ListView control.
** index = list item index (zero-based).
** path = a pointer to a PATH data structure
**
** Returns: TRUE upon success, or FALSE if an error exists.
**
** Notes: Use these functions with the PathTab ListView
** control.
*/
#include "AppPaths.h"
extern BOOL far PL_GetItem (HWND list,int index,LPPATH path)
{
ListView_GetItemText (list,index,COLUMN_1,path->name,PSTRING);
ListView_GetItemText (list,index,COLUMN_2,path->application,PSTRING);
ListView_GetItemText (list,index,COLUMN_3,path->path,KSTRING);
path->index = index;
return (TRUE);
}
extern BOOL far PL_PutItem (HWND list,int index,LPPATH path)
{
ListView_SetItemText (list,index,COLUMN_1,path->name);
ListView_SetItemText (list,index,COLUMN_2,path->application);
ListView_SetItemText (list,index,COLUMN_3,path->path);
path->index = index;
return (TRUE);
}
extern BOOL far PL_AddItem (HWND list,LPPATH path)
{
auto int index = ListView_GetItemCount (list);
auto LV_ITEM item = { NIL };
item.mask = LVIF_TEXT;
item.iItem = index;
item.iSubItem = COLUMN_1;
item.pszText = path->name;
ListView_InsertItem (list,&item);
ListView_SetItemText (list,index,COLUMN_2,path->application);
ListView_SetItemText (list,index,COLUMN_3,path->path);
ListView_EnsureVisible (list,index,FALSE);
LV_SetCurSel (list,index);
path->index = index;
return (TRUE);
}
/* end of PL_Help.c - written by Gregory Braun */