Results 1 to 6 of 6

Thread: Lock And Unlock multiple Directories

Threaded View

  1. #2
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: Lock And Unlock multiple Directories

    Honestly I don't really know what this "locking" is but I can see the problem. Only one is unlocked because you are Closing the handle to hDir. hDir is set to the last CreateFile return value that you got from clicking the mnuBlock. So it's only applying to the very last one. You will need to save all these handles so you can close them all.

    Edit: It looks like you are "locking" the files by literally having the OS lock access to them because there is an open file handle. If you are doing this for security, that is a very poor way to handle it. File security should be handled by either encrypting the file, or by higher level user access control.
    Last edited by danecook21; Nov 10th, 2010 at 12:22 PM.

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