LImageListControl::MsgProcCallBack

#include "ltwrappr.h"

virtual LRESULT LImageListControl::MsgProcCallBack(hWnd, uMsg, wParam, lParam)

This function is called for each message the image list control receives.

Parameters

HWND hWnd

Handle to the bitmap window.

UINT uMsg

The window message.

WPARAM wParam

The first parameter of the window message.

LPARAM lParam

The second parameter of the window message.

Returns

The result of processing a specific message.

Comments

Override this function to do your own processing of window events and messages. If you override this function you will be called prior to the image list control's own message processing.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

// define user LImageListControl class to override CallBack 
/*<struct>*/ 
#ifdef LMyImgList 
class LMyImgList : public LImageListControl 
{ 
public: 
   LMyImgList(); 
   virtual ~LMyImgList(); 
   virtual LRESULT MsgProcCallBack( HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam); 
   virtual L_VOID ItemSelected(L_INT nCtlID, pLILITEMSEL pItemSel); 
}; 
#endif // #ifdef LMyImgList 
/*</struct>*/ 
 
LMyImgList::LMyImgList() 
{ 
} 
 
LMyImgList::~LMyImgList() 
{ 
} 
 
LRESULT LMyImgList::MsgProcCallBack(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) 
{ 
   UNREFERENCED_PARAMETER(wParam); 
 
   CString csOut; 
   if(uMsg == WM_MOUSEMOVE) 
   { 
      L_INT nIndex; 
      POINT Point; 
      Point.x = LOWORD(lParam); 
      Point.y = HIWORD(lParam); 
      nIndex = HitTest(&Point); 
      if(nIndex >= 0) 
      { 
         csOut.Format(TEXT("Item# %ld at X: %ld , Y: %ld"), nIndex, LOWORD(lParam), HIWORD(lParam)); 
         ::SetWindowText(::GetParent(hWnd), csOut); 
      } 
      else 
      { 
         csOut.Format(TEXT("X: %ld , Y: %ld"), LOWORD(lParam), HIWORD(lParam)); 
         ::SetWindowText(::GetParent(hWnd), csOut); 
      } 
      return TRUE; 
   } 
   return FALSE; 
} 
 
L_VOID LMyImgList::ItemSelected(L_INT nCtlID, pLILITEMSEL pItemSel) 
{ 
   UNREFERENCED_PARAMETER(nCtlID); 
 
   CString csOut; 
   csOut.Format(TEXT("Item #%ld Selected!"), pItemSel->lIndex); 
   AfxMessageBox(csOut); 
} 
 
// create the control 
L_INT LImageListControl__MsgProcCallBackExample(HWND hParent, LMyImgList m_MyImgList)  
{ 
   // create the control 
   if(m_MyImgList.CreateControl(hParent, 0, WS_VISIBLE|WS_BORDER|WS_CHILD|WS_TABSTOP, 100, 300) == NULL) 
      return FAILURE; 
 
   return SUCCESS; 
} 
Help Version 22.0.2021.9.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help