This topic has not yet been rated - Rate this topic

GetConsoleOriginalTitle function

Applies to: desktop apps only

Retrieves the original title for the current console window.

Syntax

DWORD WINAPI GetConsoleOriginalTitle(
  __out  LPTSTR lpConsoleTitle,
  __in   DWORD nSize
);

Parameters

lpConsoleTitle [out]

A pointer to a buffer that receives a null-terminated string containing the original title.

The storage for this buffer is allocated from a shared heap for the process that is 64 KB in size. The maximum size of the buffer will depend on heap usage.

nSize [in]

The size of the lpConsoleTitle buffer, in characters.

Return value

If the function succeeds, the return value is the length of the string copied to the buffer, in characters.

If the buffer is not large enough to store the title, the return value is zero and GetLastError returns ERROR_SUCCESS.

If the function fails, the return value is zero and GetLastError returns the error code.

Remarks

To set the title for a console window, use the SetConsoleTitle function. To retrieve the current title string, use the GetConsoleTitle function.

To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or later. For more information, see Using the Windows Headers.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Wincon.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

Unicode and ANSI names

GetConsoleOriginalTitleW (Unicode) and GetConsoleOriginalTitleA (ANSI)

See also

Console Functions
GetConsoleTitle
SetConsoleTitle

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ