Good day! I have a problem ... I need to open a text file xxx.log (event log) that is occupied by another program and output all the contents either to МЕМО or RICHEDIT .

    2 answers 2

    make a copy and read it

    • @korok IMHO is really the right decision. - Mikha Nikolaev
    • one
      What is the difference? If the file cannot be opened for reading, it cannot be copied. - Ildar
    • Open the file does not succeed as it is probably used in exclusive access and copy succeed. - p_redator

    Work with files in Windows. It depends on the mode in which the file is opened by other programs. If, for example, for reading, then nothing prevents you from also opening for reading and reading. If the file is opened in exclusive access, there is nothing you can do except to forcibly release this file from other programs (destroy all the descriptors).
    See the WinAPI CreateFile function.