Consultor Eletrônico



Kbase 17287: How to Call WIN32 API Function: SetConsoleTitle
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/10/1998
How to Call WIN32 API Function: SetConsoleTitle

DISCLAIMER:
===========
The code example in this knowledgebase is for informational purposes
only. If you have specific questions about which API calls would be
best suited to your design goals, please consult your Microsoft
documentation.

INTRODUCTION:
=============
The following sample code shows how to call the Win32 API function
called SetConsoleTitle. This function sets the title bar string for
the current console window. This function is only useful when
running the 32-Bit Character Client (i.e. _PROGRES.EXE).

This code has been tested on Windows NT 4.0 Workstation only.


DEFINE VARIABLE chrTitle AS CHARACTER NO-UNDO FORMAT "X(128)".
DEFINE VARIABLE intResult AS INTEGER NO-UNDO.

PROCEDURE SetConsoleTitleA EXTERNAL "KERNEL32.DLL":
DEFINE INPUT PARAMETER chrConsoleTitle AS CHARACTER.
DEFINE RETURN PARAMETER intResult AS LONG.
END PROCEDURE.

RUN SetConsoleTitleA ("New Console Window Title", OUTPUT intResult).

IF intResult <> 0 THEN
MESSAGE "Title was changed" VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Title change failed" VIEW-AS ALERT-BOX.

Progress Software Technical Support Note # 17287