Gunnar Adams:
> 1. Use additional styles with the changeable style flag set to false for anything in the first line. ==> I do not like the idea to duplicate all styles
Yes, this is a problem. There should instead be a (potentially invisible) indicator for protected areas.
> and am unsure, if I can prevent ALL possible changes by doing that (will a user be able to select the whole first line and delete it?).
Whether to allow deletion of whole protected sections is one of the key questions for this function. Currently Scintilla does not allow deleting any of the text which is not changeable. To experiment, try using the notchangeable attribute in SciTE, so, for example with C++ line comments:
style.cpp.2=$(colour.code.comment.box),$(font.code.comment.box),notchangeable,back:#FFDEDE
> 3. Modify the scintilla dll in order to prevent modification of the first line or line ranges.
> ==> because this would require least modification to the containing application, I think this may actually be the best option. Where would I have to start?
Search for RangeContainsProtected in the source.
Have a look at previous discussions like
https://groups.google.com/d/topic/scintilla-interest/649-PGt0bKE/discussion
Neil