Results 1 to 2 of 2

Thread: FindFirstChangeNotification

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Posts
    53

    Thumbs up

    Hi ,


    FOR FindFirstChangeNotification api

    return value is a handle to a find change notification object


    How do I use these object to get the file path and name.

    Thanks,


    Milind.

  2. #2
    Fanatic Member faisalkm's Avatar
    Join Date
    Oct 2000
    Location
    Germany
    Posts
    752
    Private Const FILE_NOTIFY_CHANGE_ATTRIBUTES = &H4
    Private Const FILE_NOTIFY_CHANGE_DIR_NAME = &H2
    Private Const FILE_NOTIFY_CHANGE_FILE_NAME = &H1
    Private Const FILE_NOTIFY_CHANGE_SIZE = &H8
    Private Const FILE_NOTIFY_CHANGE_LAST_WRITE = &H10
    Private Const FILE_NOTIFY_CHANGE_SECURITY = &H100
    Private Const FILE_NOTIFY_CHANGE_ALL = &H4 Or &H2 Or &H1 Or &H8 Or &H10 Or &H100
    Private Declare Function FindFirstChangeNotification Lib "kernel32" Alias "FindFirstChangeNotificationA" (ByVal lpPathName As String, ByVal bWatchSubtree As Long, ByVal dwNotifyFilter As Long) As Long
    Private Declare Function FindCloseChangeNotification Lib "kernel32" (ByVal hChangeHandle As Long) As Long
    Private Declare Function FindNextChangeNotification Lib "kernel32" (ByVal hChangeHandle As Long) As Long
    Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
    Private Declare Function ResetEvent Lib "kernel32" (ByVal hEvent As Long) As Long

    Private Sub Form_Load()
    Dim Ret As Long
    Ret = FindFirstChangeNotification("C:\", &HFFFFFFFF, FILE_NOTIFY_CHANGE_ALL)
    WaitForSingleObject Ret, &HFFFFFFFF
    MsgBox "Event Triggered for the first time"
    FindNextChangeNotification Ret
    WaitForSingleObject Ret, &HFFFFFFFF
    MsgBox "Event Triggered for the second time"
    FindCloseChangeNotification Ret
    End Sub


    May be this help u
    Faisal Muhammed
    Homepage:I Started making it in 1994 ...Still Under Construction
    Using

    Visual Basic 6.0 Enterprise SP5
    Embedded Visual Basic 3.0
    SQL Server 2000
    Windows 2000 Proff
    Delphi 6.0


    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

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