by Richard Russell, September 2016

A TEXTEDITOR control (or a TEXTBOX) can easily be made read-only using the _ES_READONLY stylebit, but this doesn't work with a Text Window. You can achieve the desired result using the code below:

    open "Read Only Text Window" for text as #w
    hw = hwnd(#w)
    calldll #user32, "SendMessageA", hw as ulong, _
      _EM_SETREADONLY as long, 1 as long, 0 as long, r as long
    #w "The quick brown fox jumps over the lazy dog."
    wait