Hi Guys,
I need a little help here . . .
I need make an icon on the taskbar flash or change appearance depending if a folder on my server is empty or not.
ie : flashing icon if this folder has stuff in it.
ie : a solid icon if its empty.
Also this little program has to check this folder every 10 mins or so !
I think I can work out the icon bit but how can I determine whether a folder is empty or not.
Any help would be greatly appreciated.
Kind regards
Andy ( aka Large )
Help needed reading a folders content
Andy,
Take a look at the following API example. (It will only work with a registered copy).
It sets up a notification hook on a directory. If the contents of the folder change your program is notified.
Take a look at the following API example. (It will only work with a registered copy).
It sets up a notification hook on a directory. If the contents of the folder change your program is notified.
Code: Select all
;Converted from a VB example by:
;KPD-Team 2000
;URL: http://www.allapi.net/
;E-Mail: KPDTeam@Allapi.net
;Set the notification hook
Ret = FindFirstChangeNotification_("d:\test", $FFFFFFFF, #FILE_NOTIFY_CHANGE_FILE_NAME)
;Wait Until the event is triggered
WaitForSingleObject_(Ret, $FFFFFFFF)
MessageRequester("", "Event Triggered For the first time", 0)
;Reactivate our hook
FindNextChangeNotification_(Ret)
;Wait Until the event is triggered
WaitForSingleObject_(Ret, $FFFFFFFF)
MessageRequester("", "Event Triggered For the second time", 0)
;Remove our hook
FindCloseChangeNotification_(Ret)
Or, to just see if a directory is empty or not:
Code: Select all
Debug PathIsDirectoryEmpty_("c:\") ; Returns 1 if empty.I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
"PureBasic won't be object oriented, period" - Fred.


