Results 1 to 2 of 2

Thread: Check directory content change with API call

  1. #1
    Reynard
    Guest

    Post Check directory content change with API call

    I need my directory to be frequently checked, if there are any new files in there. If there are the files are being read (and parsed) and deleted afterwards. I have that stuff done actually already (thanx to Peet !! ), here's the code which does it:

    ------------------------------------------
    Private Sub Timer1_Timer()
    Dim sFile As String
    Dim sPath As String
    sPath = "C:\ABCD\"
    While Dir(sPath & "*.*", vbHidden + vbNormal + vbReadOnly + vbSystem) <>
    ""
    sFile = Dir(sPath & "*.*", vbHidden + vbNormal + vbReadOnly +
    vbSystem)
    MsgBox sFile
    'parse thing
    'delete the file etc.
    Kill sPath & sFile
    Wend
    End Sub
    ----------------

    Because I have timer to check the directory change (every 3 seconds) I would like to improve it with some API call (so that OS will let it know when it changes and timer wont be needed anymore). Please help me with that, I have no idea how to do it with API...

    Thanx in advance !

  2. #2
    Addicted Member darrenl's Avatar
    Join Date
    Jul 2000
    Location
    Portsmouth, UK
    Posts
    148
    Reynard,

    Brad Martinez web site has a very good eample for recieving shell change notifications. You can download the exmple from :-
    ://www.mvps.org/btmtz/shnotify
    Dazzer

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