L_ILM_LOADDATABASE

Send this message to have the ImageList Control load items from a previously saved database (multipage TIFF file).

Parameter

Description

wParam

Ignored, use 0.

lParam

Pointer to the filename from which the database will be loaded.

Returns

SUCCESS

Function was successful.

< 0

An error occurred. Refer to Return Codes.

Comments

The text for each item will be read from the CMNT_SZNAMEOFPAGE comment.

The associated macro is:

L_ImgListLoadDatabase(hWnd, pszFilename)

For a complete list of available macros, refer to the Ltlst.h file.

See Also

Elements:

L_ReadFileComment, L_SetComment, L_WriteFileComment, L_ILM_SAVEDATABASE, L_ILM_INSERT

Topics:

Using the ImageList Control
Image List Control Messages

Example

HWND hCtl;
HWND hWndFrame;
L_VOID LoadDatabase()
{
   L_INT nRet;
   OPENFILENAME OFN;
   L_TCHAR szFilter[] = {TEXT("ImgListDB\0")                    TEXT("*.tif\0\0")};
   L_TCHAR szFile[L_MAXPATH] = TEXT("\0");

   memset(&OFN, 0, sizeof(OFN));

   OFN.lStructSize       = sizeof(OPENFILENAME);
   OFN.hwndOwner         = hWndFrame;
   OFN.lpstrFilter       = szFilter;
   OFN.lpstrCustomFilter = NULL;
   OFN.lpstrFile         = szFile;
   OFN.nMaxFile          = sizeof(szFile);
   OFN.lpstrFileTitle    = NULL;
   OFN.lpstrTitle        = "Load Database";
   OFN.lpstrDefExt       = NULL;
   OFN.lpfnHook          = NULL;

   if(GetOpenFileName(&OFN))
   {
      nRet = SendMessage(hCtl, L_ILM_LOADDATABASE, (WPARAM)0, (LPARAM)szFile);

      if(nRet != SUCCESS)
         MessageBox(hWndFrame, TEXT("Error loading file!"), TEXT("Error"), MB_OK);
   }
}