GetClassInfoEx Function

Declare Function GetClassInfoEx Lib "user32.dll" Alias "GetClassInfoExA" (ByVal hinst As Long, ByVal lpszClass As String, lpwcx As WNDCLASSEX) As Long

Platforms

Description & Usage

GetClassInfoEx retrieves all of the information associated with a window class. The information is placed into the structure passed as lpwcx.

Return Value

If an error occured, the function returns 0 (use GetLastError to get the error code). If successful, the function returns a non-zero value.

Visual Basic-Specific Issues

None.

Parameters

hinst
A handle to the instance which owns the window class, or 0 if the window class is defined by the operating system.
lpszClass
The name of the window class to retrieve information about.
lpwcx
Receives the information about the window class.

Example

' This code is licensed according to the terms and conditions listed here.

' Draw the regular icon and small icon from the window class to which
' window Form1 belongs.  The two icons are drawn on Form1.
Dim classinfo As WNDCLASSEX  ' receives the class information
Dim classname As String  ' receives the name of the window class
Dim slength As Long  ' the length of the window class's name
Dim retval As Long  ' return value

' First, get the name of the window class to which Form1 belongs.
classname = Space(255)  ' make enough room in the buffer
slength = GetClassName(Form1.hWnd, classname, 255)  ' get the name
classname = Left(classname, slength)  ' remove the empty space

' Get the information about the window class.  Since this is a Visual Basic-
' generated window, its window class belongs to the application.
retval = GetClassInfoEx(App.hInstance, classname, classinfo)

' Now draw the window class's regular and small icons on window Form1.
' Draw the regular icon.
retval = DrawIconEx(Form1.hDC, 0, 0, classinfo.hIcon, 0, 0, 0, 0, DI_NORMAL)
' Draw the small icon.
retval = DrawIconEx(Form1.hDC, 50, 0, classinfo.hIconSm, 0, 0, 0, 0, DI_NORMAL)

See Also

GetClassInfo, GetClassLong

Category

Window Classes

Go back to the alphabetical Function listing.
Go back to the Reference section index.


Last Modified: August 21, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/g/getclassinfoex.html