home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
RL_Help.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
2KB
|
63 lines
/* RL_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).
** help = a pointer to a RUN data structure
**
** Returns: TRUE upon success, or FALSE if an error exists.
**
** Notes: Use these functions with the RunTab ListView
** control.
*/
#include "AppPaths.h"
extern BOOL far RL_GetItem (HWND list,int index,LPRUN run)
{
ListView_GetItemText (list,index,COLUMN_1,run->name,PSTRING);
ListView_GetItemText (list,index,COLUMN_2,run->path,PSTRING);
run->index = index;
return (TRUE);
}
extern BOOL far RL_PutItem (HWND list,int index,LPRUN run)
{
ListView_SetItemText (list,index,COLUMN_1,run->name);
ListView_SetItemText (list,index,COLUMN_2,run->path);
run->index = index;
return (TRUE);
}
extern BOOL far RL_AddItem (HWND list,LPRUN run)
{
auto int index = ListView_GetItemCount (list);
auto LV_ITEM item = { NIL };
item.mask = LVIF_TEXT;
item.iItem = index;
item.iSubItem = COLUMN_1;
item.pszText = run->name;
ListView_InsertItem (list,&item);
ListView_SetItemText (list,index,COLUMN_2,run->path);
ListView_EnsureVisible (list,index,FALSE);
LV_SetCurSel (list,index);
run->index = index;
return (TRUE);
}
/* end of RL_Help.c - written by Gregory Braun */