VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

With this code you can create a application that watches specified folders. When someone try's to a

Shayne Cairns  (5 Submissions)   Windows System Services   VB 6.0   Unknown Difficulty   Thu 24th August 2006   Mon 8th February 2021

With this code you can create a application that watches specified folders. When someone try's to access a folder that is being watched, the

API Declarations


'that was'nt important
'Copy the following in to a module.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Const NILL = 0&
Const WM_SYSCOMMAND = &H112
Const SC_CLOSE = &HF060

'----------------------------------

Public Sub sFolderGuard(ByVal sWindow As String)
Dim sReadMessage As String

hWndX = FindWindow(vbNullString, sWindow)
sCloseWindow = SendMessage(hWndX, WM_SYSCOMMAND, SC_CLOSE, NILL)

If FindWindow(vbNullString, sWindow) Then

MsgBox "Message",vbCritical,"Title"
Exit Sub

End If

End Sub

Rate With this code you can create a application that watches specified folders. When someone try's to a (2(2 Vote))
With this code you can create a application that watches specified folders. When someone try's to a.bas

With this code you can create a application that watches specified folders. When someone try's to a Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters