This code locks the files which are desired to be.These files can be unlocked whenever desired.This is a real good api and helps to lock the
API Declarations
'In case if you need any help of security of files
'please contact [email protected]
Option Explicit
Private Const OPEN_EXISTING = 3
Private Const PATH_FILE = "C:\WINNT\Profiles\vishal\Desktop\newnewRegistry.doc"
Private Declare Function CreateFile Lib "kernel32" _
Alias "CreateFileA" _
(ByVal lpFileName As String, ByVal dwDesiredAccess As Long, _
ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, _
ByVal dwCreationDisposition As Long, _
ByVal dwFlagsAndAttributes As Long, _
ByVal hTemplateFile As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long