L_ILM_GETSELOPTIONS

Send this message to get the ImageList Control's current selection options.

Parameter

Description

wParam

Ignored, use 0.

lParam

Pointer to an LILSELOPTION structure to be filled with the current 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 options.
You must set the uStructSize member of the LILSELOPTION structure before using this message.

The default selection options are:

uAllowSelection

ALLOWSELECTION_NONE

uSelectionStyle

SELECTIONSTYLE_SELECTCOLOR

crSelection

RGB(0,0,255)

The associated macro is:

L_ImgListGetSelOptions(hWnd, pSelOptions)

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

See Also

Elements:

L_ILM_SETSELOPTIONS, L_ILM_GETITEMOPTIONS, L_ILM_SETITEMOPTIONS

Topics:

Using the ImageList Control

 

Image List Control Messages

Example

 L_INT ILM_GETSELOPTIONSExample(HWND hCtrl)
{
   if(IsWindow(hCtrl))
   {
      LILSELOPTION Opt; /* selection options structure */
      L_INT nRet;

      /* get current selection options */

      Opt.uStructSize = sizeof(LILSELOPTION);
      nRet = (L_INT)SendMessage(hCtrl, L_ILM_GETSELOPTIONS, 0, (LPARAM)&Opt);

      /* now, set some new options */
      if(Opt.uAllowSelection != ALLOWSELECTION_MULTI)
         Opt.uAllowSelection = ALLOWSELECTION_MULTI;
      Opt.uSelectionStyle = SELECTIONSTYLE_SELECTCOLOR;
      Opt.crSelection     = RGB(0,255,0);
      nRet = (L_INT)SendMessage(hCtrl, L_ILM_SETSELOPTIONS, 0, (LPARAM)&Opt);

      /* update the control */
      RedrawWindow(hCtrl, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);

      return nRet;
   }
   else
      return ERROR_INVALID_PARAMETER;
}