Problem:
How to use the SetWindowText Windows API in a COBOL program.
Resolution:
Character user interface.
RUNW.EXE - COBOL TEXT window.
SPECIAL-NAMES.
CONSOLE IS CRT
CRT STATUS IS WA-FUNCTION
CALL-CONVENTION 74 IS WinAPI.
WORKING-STORAGE SECTION.
01 wHwnd pic xxxx comp-5.
01 statusCode pic xx comp-5.
01 SetWindowTextReturn pic xxxx comp-5.
PROCEDURE DIVISION.
display spaces upon crt
call WinAPI "PC_WIN_HANDLE"
using wHwnd
returning statusCode
call WinAPI "SetWindowTextA"
using by value wHwnd
by reference "Hello Application"
returning SetWindowTextReturn.
Hello Application will replace RUNW.EXE on the character screen.
