필터 지우기
필터 지우기

Avoid opening file multiple times using winopen

조회 수: 2 (최근 30일)
Daniel Liberman
Daniel Liberman 2020년 12월 31일
편집: Mario Malic 2021년 1월 1일
Hi, I am building a GUI in which for given inputs by the user several pdf files are opened. The same file can be opened multiple times for different inputs, yet I want each file to be opened only once. Is there any elegant way to do so without using counters?
  댓글 수: 3
Mario Malic
Mario Malic 2021년 1월 1일
편집: Mario Malic 2021년 1월 1일
That'll be tricky to do, especially for the reason that Adam mentioned and how fileattrib works.
On Windows, using Adobe Reader, the program itself doesn't lock the PDF file, therefore you can't use fileattrib as an indication whether the file is opened or not.
If you take a look at this answer, you can probably create a process for each PDF file (which will open many instances of PDF reader), but you have an indication whether the process is opened or not, otherwise you can use actxserver if it's available for your application. With actxserver you can probably open your PDF files in tabs and it'll be much cleaner.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by