Taneeda Posted January 7, 2019 Share Posted January 7, 2019 Nobody? Link to comment Share on other sites More sharing options...
argumentum Posted January 7, 2019 Share Posted January 7, 2019 3 hours ago, Taneeda said: Nobody? Hi What you are been asked is your code, as anyone can get the UDF. So cough up your script. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Taneeda Posted January 18, 2019 Share Posted January 18, 2019 On 1/7/2019 at 4:37 PM, argumentum said: Hi What you are been asked is your code, as anyone can get the UDF. So cough up your script. Sorry, English isn't my native language, so I don't know what you mean with "So cough up your script". When you read my posts starting from ... ...I am not sure how to get a running UDF file, because to downloadable UDF file is not running, as far as I can evaluate this. It seems to me, that the Windows 10 API has changed which must be adjusted within the UDF, which wasn't possible to me and which is the reason why I am started writing posts here --> To get informed if there is an updated and working UDF file or to get help with the adjusting of the UDF. My problem is, that I don't have any experience with the DllStruct... calls / function of AutoIt, as i wrote in previous posts... So, back to starting post of me: Is there a UDF version available which works on current windows 10 systems with current AutoIt version 3.3.14.5? Link to comment Share on other sites More sharing options...
argumentum Posted January 18, 2019 Share Posted January 18, 2019 3 hours ago, Taneeda said: so I don't know what you mean with "So cough up your script". Meaning: Post your script you could use _WinAPI_FindFirstChangeNotification.htm or something from the help file. In so far, nothing has been perfect in my experience. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Taneeda Posted January 23, 2019 Share Posted January 23, 2019 (edited) The attached zip file contains my current working copy... On 1/18/2019 at 3:55 PM, argumentum said: you could use _WinAPI_FindFirstChangeNotification.htm or something from the help file. In so far, nothing has been perfect in my experience. ...I will try to use/integrate this function, thank you very much for this hint, sounds like it could be an alternative to the UDF. au3_scripts.zip --- UPDATE --- After some research and different tries, I found WinAPI_ReadDirectoryChanges(), but the usage resulted in an execution problem, which is explained in... ...and solved by... At the moment, this nice RDC UDF solved my problems and usage of FileSystemMonitor UDF isn't necessary anymore. Edited January 23, 2019 by Taneeda Link to comment Share on other sites More sharing options...
TheDude69 Posted April 29, 2020 Share Posted April 29, 2020 This is a very brilliant UDF. 👍 I am looking for an additional feature to monitor changes on a USB attached drive beginning in the root of that drive and monitoring all changes on the drive not "only" in a given folder. I have had a look into the UDF but have not found something that would help me in this matter. Has someone of you maybe got an idea how to monitor the whole given drive for changes and also list this changes (filenames)? Many thanks in advance, best regards TheDude Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 29, 2020 Moderators Share Posted April 29, 2020 TheDude69, All I have ever managed to do with the $sShellMon_Path parameter for _FileSysMonSetup is to get the "Drive free space has changed|SHCNE_FREESPACE" message whenever a file is added/deleted anywhere on the drive - but never any details on the file itself or its location. I suppose you could use _FileListToArrayRec each time to look for changes, but it is a bit long-winded. Sorry i cannot be any more help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Nine Posted April 30, 2020 Share Posted April 30, 2020 (edited) @TheDude69 You can use _WinAPI_ReadDirectoryChanges with a USB attached drive (juste tested and working fine). Check help file for the example. Do not forget to set $bSubtree to 1 if you want to check the whole drive. Be aware that the example is used in a blocking mode. You can modify it to work in asynchronous mode, check MSDN for more explanations. edit : I did not read the whole thread, I was just answering your question. I see there is sort of a discussion around this API above. Just want to let you know that you do not need to create process threadS to make it work. It is well explained in MSDN. Edited April 30, 2020 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Champak Posted November 19, 2021 Share Posted November 19, 2021 (edited) I'm using the provided unmodified example and the thing is calling the function multiple times. Meaning one file gets dropped in the specified folder and _FileSysMonDirEventHandler gets called 3 times....prints the file on the listview twice. Am I the only one that experienced this? I tried to widdle the script down, but got nowhere with eliminating this issue. Using win10 64Bit. Any help? Thanks. edit: I fixed it by doing this to _FileSysMonDirEventHandler() and it seems to be working fine so far...but I don't think I should have to do that. If $Filename <> $NewFile Then ;MsgBox(0,$NewFile,$Filename) _FileSysMonActionEvent(0, DllStructGetData($tFNI, "Action"), $Filename) $NewFile = $Filename EndIf Edited November 19, 2021 by Champak Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 19, 2021 Moderators Share Posted November 19, 2021 Champak, Several events can indeed be fired by a single action with this UDF - this is the list I check for when using this UDF: expandcollapse popupSwitch $event_type Case 0 ; Directory event ConsoleWrite($event_id & @CRLF) Switch $event_id Case 1 $sEvent = "file added to the directory|FILE_ACTION_ADDED" Case 2 $sEvent = "file removed from the directory|FILE_ACTION_REMOVED" Case 3 $sEvent = "file was modified|FILE_ACTION_MODIFIED" Case 4 $sEvent = "file was renamed old name|FILE_ACTION_RENAMED_OLD_NAME" Case 5 $sEvent = "file was renamed new name|FILE_ACTION_RENAMED_NEW_NAME" EndSwitch Case 1 ; Shell event Switch $event_id Case 0x00000001 $sEvent = "Non-folder item name changed|SHCNE_RENAMEITEM" Case 0x00000002 $sEvent = "Non-folder item created|SHCNE_CREATE" Case 0x00000004 $sEvent = "Non-folder item deleted|SHCNE_DELETE" Case 0x00000008 $sEvent = "Folder created|SHCNE_MKDIR" Case 0x00000010 $sEvent = "Folder removed|SHCNE_RMDIR" Case 0x00000020 $sEvent = "Storage media inserted into a drive|SHCNE_MEDIAINSERTED" Case 0x00000040 $sEvent = "Storage media removed from a drive|SHCNE_MEDIAREMOVED" Case 0x00000080 $sEvent = "Drive removed|SHCNE_DRIVEREMOVED" Case 0x00000100 $sEvent = "Drive added|SHCNE_DRIVEADD" Case 0x00000200 $sEvent = "Local computer folder shared via the network|SHCNE_NETSHARE" Case 0x00000400 $sEvent = "Local computer folder not shared via the network|SHCNE_NETUNSHARE" Case 0x00000800 $sEvent = "Item or folder attributes have changed|SHCNE_ATTRIBUTES" Case 0x00001000 $sEvent = "Folder content has changed|SHCNE_UPDATEDIR" Case 0x00002000 $sEvent = "Folder or non-folder has changed|SHCNE_UPDATEITEM" Case 0x00004000 $sEvent = "Computer disconnected from server|SHCNE_SERVERDISCONNECT" Case 0x00008000 $sEvent = "System image list image has changed|SHCNE_UPDATEIMAGE" Case 0x00010000 $sEvent = "Not used|SHCNE_DRIVEADDGUI" Case 0x00020000 $sEvent = "Folder name has changed|SHCNE_RENAMEFOLDER" Case 0x00040000 $sEvent = "Drive free space has changed|SHCNE_FREESPACE" Case 0x0002381F $sEvent = "SHCNE_DISKEVENTS" Case 0x0C0581E0 $sEvent = "SHCNE_GLOBALEVENTS" Case 0x7FFFFFFF $sEvent = "SHCNE_ALLEVENTS" Case 0x80000000 $sEvent = "SHCNE_INTERRUPT" EndSwitch EndSwitch So you will need to do some detective work to check exactly which events were triggered and decide whether to action or ignore them. All I needed to do when I have used this UDF was to check for the creation of a new file, which simplified the problem considerably. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Champak Posted November 19, 2021 Share Posted November 19, 2021 That's the thing, it's the same action hitting twice and then a different one. Directory event File Added hits twice, and then something else with eventID 3 that wasn't incorporated in Directory Events. This is what the unmodified example writes to console 0|1|Folder_Monitor.au3 adding file / folder Folder_Monitor.au3 1|0x04000000| 1|0x04000000| 1|0x00040000|F 1|0x04000000| 0|1|Folder_Monitor.au3 adding file / folder Folder_Monitor.au3 0|3|Folder_Monitor.au3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now