L_ILM_GETITEMOPTIONS

Send this message to get the ImageList Control's item display options.

Parameter

Description

wParam

Ignored, use 0.

lParam

Pointer to LILITEMOPTION structure to be filled with current display options.

Returns

SUCCESS

Function was successful

< 0

An error occurred. Refer to Return Codes.

Comments

The structure pointed to by lParam will be updated with the ImageList Control's current display options.

You must set the uStructSize member of the LILITEMOPTION structure before using this message.

The default item display options are:

uVerticalSpacing

5

uHorizontalSpacing

5

uWidth

115

uHeight

115

crBackground

GetSysColor(COLOR_BTNFACE)

bDisplayItemText

TRUE

crForeground

RGB(0,0,0)

hFont

NULL (Times New Roman, 8 point)

The associated macro is:

L_ImgListGetItemOptions(hWnd, pItemOptions)

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

See Also

Elements:

L_ILM_SETITEMOPTIONS, L_ILM_GETSELOPTIONS, L_ILM_SETITEMOPTIONS

Topics:

Using the ImageList Control

 

Image List Control Messages

Example

 L_INT ILM_GETITEMOPTIONSExample(HWND hCtrl)
{
   if(IsWindow(hCtrl))
   {
      LILITEMOPTION Opt; /* item options structure */
      L_INT nRet;

      ZeroMemory(&Opt, sizeof(LILITEMOPTION));
      ///* get current item options */
      Opt.uStructSize = sizeof(LILITEMOPTION);

      SendMessage(hCtrl, L_ILM_GETITEMOPTIONS, 0, (LPARAM)&Opt);

      /* now, set some new options */
      Opt.uVerticalSpacing   = 10;
      Opt.uHorizontalSpacing = 10;
      if(Opt.uWidth < 100)
         Opt.uWidth=100;
      if(Opt.uHeight < 100)
         Opt.uHeight=100;
      Opt.crBackground       = RGB(100,100,100);
      Opt.bDisplayItemText   = FALSE;
      nRet = (L_INT)SendMessage(hCtrl, L_ILM_SETITEMOPTIONS, 0, (LPARAM)&Opt);

      /* update the control */
      RedrawWindow(hCtrl, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
      return nRet;
   }
   else
      return ERROR_INVALID_PARAMETER;
}