LImageListControl::CreateControl

Summary

Creates the image list control using the specified parameters.

Syntax

#include "ltwrappr.h"

HWND LImageListControl::CreateControl(hWndParent, nID=0, dwStyle=WS_CHILD|WS_VISIBLE|WS_BORDER|WS_TABSTOP, x=0, y=0, nCx=200, nCy=200, crBackground=RGB(128,128,128))

Parameters

HWND hWndParent

Window handle of the parent window for the ImageList Control.

L_INT nID

ID for the ImageList Control. You can use this to identify the control when you process WM_COMMAND notification messages that the control will send to its parent window.

DWORD dwStyle

Specifies the control's style, for example WS_VISIBLE, WS_BORDER, or WS_CHILD. For more information on Windows styles, refer to your compilers help file.

L_INT x

X coordinate for the origin of the ImageList Control window.

L_INT y

Y coordinate for the origin for the ImageList Control window.

L_INT nCx

The width of the ImageList Control window.

L_INT nCy

The height for the ImageList Control window.

COLORREF crBackground

The background color for the ImageList Control window.

Returns

Value Meaning
!= NULL The function was successful and the return value is the window handle for the created control.
NULL An error occurred, and the control could not be created. Refer to Return Codes.

Comments

This function causes the class object to create the control window using the specified parameters.

This will fill in the m_hWnd data member with the handle to the new window.

If you call this function for a class object that already has a created window, the function will simply return m_hWnd.

You can destroy the ImageListControl window using the Windows function DestroyWindow.

NOTE: The window is created with the WS_EX_CLIENTEDGE style by default. To change this, you can use the Windows function SetWindowLong. For a list of available styles, refer to LTIMAGELISTCLASS Registered Class: Styles.

The ImageListControl window will send command notification messages to its parent window. For a table of the available command notifications, refer to ImageList Control Command Notifications.

The ImageList Control's parent window will receive these notifications in the form of a WM_COMMAND message.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LImageListControl__CreateControlExample(HWND hParent, LImageListControl& m_ImgList) 
 
{ 
   HWND hCtl = NULL; 
 
   hCtl = m_ImgList.CreateControl(hParent, 0); 
 
   if(!::IsWindow(hCtl)) 
      AfxMessageBox(TEXT("Failed to create control!")); 
 
   return SUCCESS; 
 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.