User32GetClassName(SafeHandle, StringBuilder, Int32) Method
Retrieves the name of the class to which the specified window belongs.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static int GetClassName(
SafeHandle hWnd,
StringBuilder ClassName,
int maxCount
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetClassName (
hWnd As SafeHandle,
ClassName As StringBuilder,
maxCount As Integer
) As Integer
Dim hWnd As SafeHandle
Dim ClassName As StringBuilder
Dim maxCount As Integer
Dim returnValue As Integer
returnValue = User32.GetClassName(hWnd,
ClassName, maxCount)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static int GetClassName(
SafeHandle^ hWnd,
StringBuilder^ ClassName,
int maxCount
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetClassName :
hWnd : SafeHandle *
ClassName : StringBuilder *
maxCount : int -> int
No code example is currently available or this language may not be supported.
- hWnd SafeHandle
-
A handle to the window and, indirectly, the class to which the window belongs.
- ClassName StringBuilder
-
The class name string.
- maxCount Int32
-
The length of the ClassName buffer, in characters.
The buffer must be large enough to include the terminating null character;
otherwise, the class name string is truncated to maxCount-1 characters.
Int32
If the function succeeds, the return value is the number of characters copied to the buffer,
not including the terminating null character.
If the function fails, the return value is
0.
To get extended error information, call
GetLastWin32Error.