i'm trying to build a picture database , i want vb to track a specified folder so when u add new pictures to that folder it will automaticly add it to the database. is that possible in vb6?
There are two possible ways i can think of... one is to have a timer every minute to check the folder for any changes. The other is to use an API. The timer method could possibly use the filelistbox control, and then every minute check the total number of items, if its different then it means something was added or removed. The API method would be something like this (from the API Guide)
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
i think i'm going to try timer first but i cannot find filelistbox control in the component or Refrences. can you help where i can get that control from plz.
hi again, i made a little progress now, i want to group some pictures in folders. is there any control allow me to track folders creation? actualy i have too much folders with images so i decided to make the program to group my pictures by folder name.