Share via

如何实现一个文件被程序B打开后,程序B关闭该文件,程序A可以得到该文件已经被程序B关闭了

Neko_Now 1 Reputation point
2020-08-19T10:01:04.427+00:00

我有一个程序A,用户可以通过程序A调用系统函数:ShellExecute让系统自动通知程序B打开用户需要操作的文件,我想实现,

1.当程序B打开了这个文件后,我的程序A可以得到通知或者感知到

2.当程序B关闭了这个文件后,我的程序A也可以得到通知或者感知到

备注:

1.一个文件是可以在非独占模式下,是可以同时被多个程序打开的

请问上述功能我该如何使用Visual C++实现呢?

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-08-19T14:31:45.587+00:00

    QnA forums are currently English only. The migration notification you're seeing is in error. Only the English TechNet / MSDN forums are currently in migration. You can disregard notice, they're actively answering question in dedicated forums here.
    https://social.technet.microsoft.com/Forums/zh-CN/home

    --please don't forget to Accept as answer if the reply is helpful--

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.