Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 7th, 2005, 08:35 AM
Authorized User
Join Date: May 2004
Posts: 73
Thanks: 0
Thanked 1 Time in 1 Post
Default Know about a running process for a given resource

Hi guys,

Anybody knows about how to get to know about the OS process under which a given resource (e.g, a disk file) is in use? I am working in Windows .NET app, however no matter if the code example uses Windows APIs in language like vb/vc++. This is very important for me so early rply will be highly appreciated. thanx in advance.

Old June 9th, 2005, 07:03 AM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Are you specifically looking for a way to monitor changes to a file? There are classes that provide file watching capabilities in .NET.

Old October 13th, 2005, 03:04 AM
Authorized User
Join Date: May 2004
Posts: 73
Thanks: 0
Thanked 1 Time in 1 Post

Sorry for the late reply, i was busy in some other tasks and in the meantime i have also been trying to get solution from Win32 APIs. Let me explain it in some details. I have placed a
web browse control in my Windows Form in order to show many types of documents like word doc,
text file, ms excel sheet, images or even flash animation etc. There are three panels in this
Form. On the left panel there's a Directory tree just like we see in Windows Explorer. The Top panel contains a list of documents in the currently selected directory. I have placed the web
browser control in the third panle which is right below the top panel. When the user selects
a document (word, excel etc.) it is opened and viewed in the browser control. So far so good.
Now the problem occurs when the user selects a document and it opens for view and he
wants to delete it by using the shortcut menu option which is provided by me. The system throws
an exception when i attempt to delete this document from the os directory and says like "The file is in use by another process.". This occurs even if the user selects another document and the
application attempts to delete the 'previously' selected document again. This is for sure that
the process which is running my app has not yet destroyed the handle of the document, but i
don't know how to destory it in order to delete the file.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get running Instance of a Process not in ROT? scando C# 1 February 20th, 2018 01:06 PM
process.startinfo opens new instance of process Anypond General .NET 0 August 28th, 2008 05:35 AM
Finding commandline arguments of a running process EddyT C# 4 July 1st, 2007 10:07 AM
Resource File kk_kumar99 Beginning VB 6 3 October 23rd, 2006 04:32 AM
The resource cannot be found. ltdanp21 Dreamweaver (all versions) 2 July 21st, 2004 02:04 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.