int LSParseStarList(FILE *f,const char *key,ParseStarItemProc Parser,void *pList,size_t size,DWORD param)
Read a linked-list of elements from step.rc. Returns the number of elements read. The first item in each element structure must be a next pointer for the linked list.
FILE *f
handle of config file openned with LCOpen or NULL. if NULL, default file is used.
const char *key
step.rc token to search for
ParseStarItemProc Parser
callback to parse a line:
int ParseStarItemProc(void *element,const char *line,DWORD param);
void *element
points to a block of allocated, zeroed memory of the requested size
const char *line
the line string to parse (as if by GetRCLine)
DWORD param
the DWORD parameter passed to ParseStarList

This function can return a combination of the PSL_OK and PSL_STOP flags:

PSL_OK
The line was parsed successfully into the element, and it should be added to the list. If this flag is not set, the element will be discarded.
PSL_STOP
ParseStarList should stop parsing items and exit.
void *pList
pointer that will be the head of the linked-list
size_t size
bytes of memory that need to be allocated for each item
DWORD param
DWORD parameter that will be passed to the Parser
void LSFreeStarList(FreeStarItemProc Freer,void *pList,DWORD param);
Free the linked-list for a StarList allocated with LSParseStarList.
FreeStarItemProc Freer
called to free each element in the list:
void FreeStarItemProc(void *element,DWORD param);
void *element
the element to free, do not release the memory itself
DWORD param
the parameter passed to FreeStarList
void *pList
pointer to the head of the linked-list
DWORD param
DWORD parameter that will be passed to the Freer
void LSLinkFunctions(lsLinkItem *list);
Dynamically link functions in other libraries from a table.
// undocumented, not in import lib
void (WINAPI *SwitchToThisWindow)(HWND, int) = NULL;

// not in win95, but we can live without it
BOOL  (WINAPI *dAlphaBlend)( IN HDC, IN int, IN int, IN int, IN int,
    IN HDC, IN int, IN int, IN int, IN int, IN BLENDFUNCTION) = NULL;

// not in win95, but we can emulate it
HWND WINAPI GetAncestor95(HWND hWnd, UINT rootOwner);
HWND (WINAPI *dGetAncestor)(HWND, UINT) = &GetAncestor95;

lsLinkItem DynFuncs[] =
{
	// anything before the first dll is linked from USER32.DLL
	{ "SwitchToThisWindow", (int**)(&SwitchToThisWindow) },
	{ "GetAncestor", (int**)(&dGetAncestor) },

	// now import things from a different library
	{ "MSIMG32.DLL", NULL },
	{ "AlphaBlend", (int**)(&dAlphaBlend) },

	// end of list marker
	{ NULL, NULL }
};

LSLinkFunctions(DynFuncs);
There are two reasons to link this way instead of using an import library:
void LSUnlinkFunctions(lsLinkItem *list);
Unlink functions linked with LSLinkFunctions.
void LSRegisterBangList(const char *prefix,int prefixlen,lsBangCmdDef *Bangs);
Register bang commands from a table.
const char *prefix
a common prefix to be prepended to all bang commands (should start with !)
int prefixlen
length of the prefix string or -1 to get it with strlen. (hard code it if you can to save time)
lsBangCmdDef *Bangs
List of bang commands:
const char *Name
name of the bang command, appended to the prefix. This should be NULL to signal the last element in the table.
BangCommand *Command
pointer to the actual bang command function
void LSRemoveBangList(const char *prefix,int prefixlen,lsBangCmdDef *Bangs);
Remove bang commands from a table. Parameters are the same as for LSRegisterBangList.
int LSStringEnum(const char *string,const char **list,int inc=1);
Convert a string into an index. (not case sensitive)
const char *string
the string to match
const char **list
the list of strings to look in. This may be either an array of pointers, or an array of some structure with a string pointer as the first element. The last pointer in the list should be NULL.
int inc = 1
size of the array elements in list, in DWORDs (leave as default for a simple array of pointers)
Return value is 0-based index into the array where the string matched, or -1 if nothing matched.
char *ColorStrings[] = { "red", "green", "blue", NULL };

int GetColorComponent(const char *comp,COLORREF color)
{
  switch (LSStringEnum(comp,ColorStrings))
  {
  case 0: return GetRValue(color);
  case 1: return GetGValue(color);
  case 2: return GetBValue(color);
  }
  return 0;
}
BOOL LSTileBltAligned(HDC d, int dl, int dt, int dw, int dh, HDC s, int sl, int st, int sw, int sh, int x, int y, DWORD rop);
Tile a piece of a source bitmap, on to a piece of a destination bitmap, aligned to a point.
HDC d
destination device context
int dl, int dt
left and top of destination rectangle
int dw, int dh
width and height of destination rectangle
HDC s
source device context
int sl, int st
left and top of source rectangle
int sw, int sh
width and height of source rectangle
int x, int y
destination coordinate that will map to source left and top
DWORD rop
raster operation code, same as for BitBlt
BOOL LSTileBlt(HDC d, int dl, int dt, int dw, int dh, HDC s, int sl, int st, int sw, int sh, DWORD rop);
Tile a piece of a source bitmap, on to a piece of a destination bitmap, aligned the destination rectangle.
HDC d
destination device context
int dl, int dt
left and top of destination rectangle
int dw, int dh
width and height of destination rectangle
HDC s
source device context
int sl, int st
left and top of source rectangle
int sw, int sh
width and height of source rectangle
DWORD rop
raster operation code, same as for BitBlt
BOOL LSTransEdgeBlt(HDC d, const RECT *rDest, HDC s, lsEdgeMap *emSrc, BOOL bTransBlt);
Stretch or tile a bitmap with a static border.
HDC d
destination device context
const RECT *rDest
destination rectangle
HDC s
source device context
lsEdgeMap *emSrc
source bitmap and border specification:
HBITMAP Bitmap;
bitmap. This isn't actually used, the bitmap should be selected into the source device context.
SIZE Size;
size of bitmap
RECT Edge;
size of edge that will not be stretched/tiled. Note that this is not really a rectangle: left, top, right, and bottom contain the number of pixels from each corresponding edge.
BOOL Tile;
TRUE to tile the bitmap in the middle, FALSE to stretch it
BOOL bTransBlt
TRUE to use TransparentBltLS, FALSE to use BitBlt
BOOL LSSetPaintDesktopHook(DesktopPainterProc UserProc);
Register an external function to paint the desktop bitmap. Only one can be registerred at a time. When called, the bitmap will be filled with the system desktop color.
BOOL UserProc(HDC hdc)
Paint the desktop onto the given device context, or return FALSE to use the default painter. All coordinates should be offset by the top, left of the screen rectangle of the LSMONITOR_ALL monitor. (That is, subtract this point from all coordinates before using them on this dc.) I highly recommend using LSForEachMonitor to paint this.
struct PaintScreenData {
  HDC hdc;
  RECT rAll;
};

BOOL PaintMonitorProc(LSMONITOR Mon,LPARAM psd)
{
  RECT rMon;
  LSGetMonitorScreenRect(Mon,&rMon);
  OffsetRect(&rMon,
    -(PaintScreenData *)psd->rAll.left,
    -(PaintScreenData *)psd->rAll.top);
  // rMon is now the section of psd->hdc that should be drawn here
  Rectangle((PaintScreenData *)psd->hdc,
    rMon.left,rMon.top,rMon.right,rMon.bottom);
  return TRUE;
}

BOOL PaintScreenProc(HDC hdc)
{
  PaintScreenData psd;
  psd.hdc = hdc;
  LSGetMonitorScreenRect(LSMONITOR_ALL,&psd.rAll);
  LSForEachMonitor(&PaintMonitorProc,(LPARAM)&psd);
  return TRUE;
}

BOOL bShouldUnhookPD;
  bShouldUnhookPD = LSSetPaintDesktopHook(&PaintScreenProc);
...
  if (bShouldUnhookPD) LSSetPaintDesktopHook(NULL);
Calling LSSetPaintDesktopHook with NULL will remove the hook. You should never remove the hook unless you successfully set it.
void LSPaintDesktop(HDC hdcD, int xD, int yD, int cxD, int cyD, int xS, int yS, BOOL bUpdateCache=FALSE);
Like PaintDesktop, but will work on a memory device context, and with the PaintDesktopHook. Use this for "fake" transparency.
HDC hdcD
destination device context
int xD, int yD
left and top of destination rectangle
int cxD, int cyD
width and height of destination rectangle
int xS, int yS
left and top of source rectangle
BOOL bUpdateCache = FALSE
TRUE to force the desktop bitmap to be redrawn, this can be quite slow.
void LSFreeDesktopBmp(void);
Release the cached desktop bitmap. Don't use it unless you've got a really good reason.