Kernel32GetConsoleTitle Method
Retrieves the title for the current console window.
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("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static uint GetConsoleTitle(
StringBuilder buffer,
uint bufferSize
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function GetConsoleTitle (
buffer As StringBuilder,
bufferSize As UInteger
) As UInteger
Dim buffer As StringBuilder
Dim bufferSize As UInteger
Dim returnValue As UInteger
returnValue = Kernel32.GetConsoleTitle(buffer,
bufferSize)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static unsigned int GetConsoleTitle(
StringBuilder^ buffer,
unsigned int bufferSize
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member GetConsoleTitle :
buffer : StringBuilder *
bufferSize : uint32 -> uint32
No code example is currently available or this language may not be supported.
- buffer StringBuilder
-
A pointer to a buffer that receives a null-terminated string containing the title.
If the buffer is too small to store the title,
the function stores as many characters of the title as will fit in the buffer,
ending with a null terminator.
- bufferSize UInt32
-
The size of the buffer pointed to by the buffer parameter, in characters.
UInt32
If the function succeeds, the return value is the length of the console window's title, in characters.
If the function fails, the return value is zero and GetLastError returns the error code.