Kbase 17286: How to Call WIN32 API Function: GetConsoleTitle
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
How to Call WIN32 API Function: GetConsoleTitle
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 GetConsoleTitle. This function retrieves 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(129)".
DEFINE VARIABLE intSize AS INTEGER NO-UNDO INITIAL 128.
DEFINE VARIABLE intResult AS INTEGER NO-UNDO.
PROCEDURE GetConsoleTitleA EXTERNAL "KERNEL32.DLL":
DEFINE OUTPUT PARAMETER chrConsoleTitle AS CHARACTER.
DEFINE INPUT PARAMETER intBufferSize AS LONG.
DEFINE RETURN PARAMETER intResult AS LONG.
END PROCEDURE.
ASSIGN chrTitle = FILL(" ",128).
RUN GetConsoleTitleA (OUTPUT ChrTitle, IntSize, OUTPUT intResult).
IF intResult <> 0 THEN
MESSAGE chrTitle VIEW-AS ALERT-BOX.
ELSE
MESSAGE "Buffer size is too small" VIEW-AS ALERT-BOX.
Progress Software Technical Support Note # 17286