Skip to main content

How to change the character text interface window title

  • February 15, 2013
  • 0 replies
  • 0 views

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.

Old KB# 5203

0 replies

Be the first to reply!