Main Topics
Browse All TopicsHi, i have made an application that grabs the screen and then saves the file to my desktop.
This jpg created is being used by another application to send it to mobile phones via a Bluetooth proximity application.
Problem is, when i open the file in the Bluetooth application to send it, if i run MY application to recreate the screen grab then i get an error that the file is being used by an other application.
Is there a way to overwrite the jpg WITHOUT closing the Bluetooth app? There is NO way altering the Bluetooth app to do that.
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yes, after sending the file, even if you remove it from the Files List to be send, the file remains locked, so maybe there is a bug in the BT app.
That's why i am asking if there is a way to unlock the file, i don't think that the BT app need the file to be locked, since it's sent over.
By the way, i use VB2008 express
Ok this is probably a bit of a hack but I use this program for unlocking locked files manually
http://ccollomb.fr
Appar
Ultmatley though there must be a Win API for this.
You can use API heres how:
Call NtQuerySystemInformation with the SystemHandleInformation class.
This returns you an array of SYSTEM_HANDLE_INFORMATION.
The SYSTEM_HANDLE_INFORMATION has processid and handle information
that can be used for parsing. What you need to do is search the array of handles for the
process id that matches the blue tooth device and then dump all the handles which have a
object type of "File". You will need to use DuplicateHandle() for the handle to work in your
context and specifying DUPLICATE_CLOSE_SOURCE in DuplicateHandle() will force the close.
Business Accounts
Answer for Membership
by: Dov_LandauPosted on 2009-06-24 at 06:57:20ID: 24701095
Hello,
The lock is designed exactly for this situation, that one application should not change the file while the 2nd app uses the file's data. The question is: does the bluetooth app hold the lock on the file infinitely - even after the transfer has finished? Do you mean to say that you want to bypass a bug in the bluetooth app?