Declare Function GetClassInfo Lib "user32.dll" Alias "GetClassInfoA" (ByVal hInstance As Long, ByVal lpClassName As String, lpWndClass As WNDCLASS) As Long
GetClassInfo retrieves most of the information associated with a window class. The information is placed into the structure passed as lpWndClass.
If an error occured, the function returns 0 (use GetLastError to get the error code). If successful, the function returns a non-zero value.
None.
' This code is licensed according to the terms and conditions listed here. ' Draw the icon and cursor from the window class to which window ' Form1 belongs. The two images are drawn on Form1. Dim classinfo As WNDCLASS ' 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 = GetClassInfo(App.hInstance, classname, classinfo) ' Now draw the window class's icon and cursor on window Form1. ' Draw the icon. retval = DrawIconEx(Form1.hDC, 0, 0, classinfo.hIcon, 0, 0, 0, 0, DI_NORMAL) ' Draw the cursor. If it's animated, draw only the first frame of it. retval = DrawIconEx(Form1.hDC, 50, 0, classinfo.hCursor, 0, 0, 0, 0, DI_NORMAL)
GetClassInfoEx, GetClassLong
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/getclassinfo.html