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