Click here to Skip to main content
15,889,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello

So long time i have reseach for how to susspend process befere file open but i didnt get any good source for this.

so i want to this...

i have some file list on disk and if any file is opening on the listed file then application will suspend proccess and will give some information as like PID , FileName , Accessing application as like.

Basic schema

Some File List
A.doc
B.xls
c.txt

C/C++ structure

Look for process and suspend before start and find process looking file
if looking file equal Some File List then kill process and do feedBack

thanks for help

What I have tried:

i didnt get any solition for this problem
Posted
Updated 19-Sep-18 1:49am
Comments
Dave Kreskowiak 19-Sep-18 9:07am    
Your entire application is a list of problems to solve. You're apparently trying to find a solution to the entire application.

You have to break this down into smaller units. Are you trying to find out if a file is being opened? Or are you trying to find out out to suspend a process?

Oh, keep in mind that suspending a process can result in that process crashing as not every application is written to support it.
ErdemGurgenci 24-Sep-18 8:44am    
hi thanks for your answer. just am i have to get file state so if file opening or open then i have to find which progress using this file. and i will check process with process id and if process is having problem then i will kill this process

so starting being open file

thanks again i hope can i get solution with your answers

1 solution

Here is an article that will show you how to look for the process, from there you should be able to do the rest
Listing Used Files[^]
 
Share this answer
 
Comments
ErdemGurgenci 24-Sep-18 8:47am    
Hi thansk for replay. yes i have check this solution befor but its showing used file in runtime. i need the get process information being open file

thanks again hope i can get a solition with your answers
CHill60 24-Sep-18 11:12am    
The article shows how to find a file that is open and then which process has it open... which is how you described the problem. I'm confused, perhaps you need to describe your problem in more detail
ErdemGurgenci 24-Sep-18 17:27pm    
think about please... i have an excel file and i want to get process detail before the file is opened (find out if a file is being opened) (sorry my engilis is not good)
thanks
CHill60 25-Sep-18 3:46am    
Getting a list of running processes is easy but you are never going to be able to predict if one is going to open a file before it actually does so

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900