CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    1,798

    Need help detecting a process

    I wish my application to be able to Lock and Unlock a file programatically. The so-called 'lock' and 'unlock' is actually a disk file encryption and decryption respectively, where the encrypted file name is *.lck and the decrypted file name is .*dat (both binary files).

    For security, I wish to have my application delete the decrypted (aka, unlocked) file from the disk after it has been used.

    My problem is that sometimes the 'lock' works and at other times it does not. When it does not work, the GetLastError message is:
    DeleteFile(inFile) failed with error32: The process cannot access the file because it is being used by another process.
    I would like to know specifically which 'another process' is preventing the locked file from being accessed. Is there some clever way to detect this malevolent process, say using Spy++ or some such?
    mpliam

  2. #2
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Need help detecting a process

    Give this a shot:
    Sysinternals Handle utility

  3. #3
    Join Date
    Nov 2003
    Posts
    1,902

    Re: Need help detecting a process

    If you really need to do it yourself : http://forum.sysinternals.com/forum_posts.asp?TID=14546

    gg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured