program-id. monitortest. working-storage section. copy "iscobol.def". 77 key-status is special-names crt status pic 9(4) value 0. 77 window-handle handle of window. 77 ws-scr-index pic s9(6) value 0. 01 ws-monitor-count pic 99. 01 ws-main-index pic 99. 01 ws-line pic zz9. 01 ws-column pic zz9. 01 ws-cmonitor-usable-screen-height pic z(4). 01 ws-cmonitor-usable-screen-width pic z(4). 01 ws-cmonitor-physical-screen-height pic z(4). 01 ws-cmonitor-physical-screen-width pic z(4). 01 ws-cmonitor-start-y pic -(4)9. 01 ws-cmonitor-start-x pic -(4)9. screen section. 01 screen-1. 03 label line 2 column 2 size 10 title "Monitor # :" . 03 Entry-Field line 2 column 15 size 8 boxed center read-only value ws-scr-index . 03 Label line 5 column 2 title "Monitor Info :" . 03 Label line 7 column 2 title "cmonitor-usable-screen-height:" . 03 Label line 7 column 30 title ws-cmonitor-usable-screen-height right size 6 . 03 Label line 9 column 2 title "cmonitor-usable-screen-width:" . 03 Label line 9 column 30 title ws-cmonitor-usable-screen-width right size 6 . 03 Label line 11 column 2 title "cmonitor-physical-screen-height:" . 03 Label line 11 column 30 title ws-cmonitor-physical-screen-height right size 6 . 03 Label line 13 column 2 title "cmonitor-physical-screen-width:" . 03 Label line 13 column 30 title ws-cmonitor-physical-screen-width right size 6 . 03 Label line 15 column 2 title "cmonitor-start-y:" . 03 Label line 15 column 30 title ws-cmonitor-start-y right size 6 . 03 Label line 17 column 2 title "cmonitor-start-x:" . 03 Label line 17 column 30 title ws-cmonitor-start-x right size 6 . 03 Push-Button line 19 column 2 title "Exit" . procedure division. MAIN. call "c$monitor" using cmonitor-get-no-monitor ws-monitor-count, ws-main-index. if ws-monitor-count > 1 move 2 to ws-scr-index else move 1 to ws-scr-index end-if perform GET-MONITOR-INFO display standard graphical window background-low screen line 10 screen col 10 screen-index ws-scr-index size 50 lines 20 label-offset 20 color 257 title "Test C$MONITOR" handle window-handle display screen-1 accept screen-1 destroy screen-1 destroy window-handle goback. GET-MONITOR-INFO. call "c$monitor" using cmonitor-get-monitor-info ws-scr-index cmonitor-data giving return-code move cmonitor-usable-screen-height to ws-cmonitor-usable-screen-height move cmonitor-usable-screen-width to ws-cmonitor-usable-screen-width move cmonitor-physical-screen-height to ws-cmonitor-physical-screen-height move cmonitor-physical-screen-width to ws-cmonitor-physical-screen-width move cmonitor-start-y to ws-cmonitor-start-y move cmonitor-start-x to ws-cmonitor-start-x .