lasaucisse Posted December 10, 2009 Share Posted December 10, 2009 (edited) hi, first, excuse my poor english, i'm french I'm coding un GUI for a tool, whose goal is to automate some actions with this tool, by sendind hotkeys. I have to use the send() function because the WinMenuSelectItem() function fail : no detected menu in my tool with Au3info.exe. At the end of my hotkeys sequence, I need to save the current file, then to close it. my problem : for big files, the saving process takes some time (several seconds), so I need to wait before to send the "close" hotkeys. So I need to know how many time I have to wait, so I need to check if the saving process is finished or not. but I can't find the way to do that ! I tried to checked : - if the file can be read or write while the process...failed, no error code, I can open in read or write mode, although the file is still being written ! - the file's size : it's change during the save process, but not continuous : I can check if the file's size didn't change since seconds, but I'll have to wait at least 4 or 5 seconds to be sure it's ended : too long ! same limitation with file's timestamps... - the file's attributes, it's "A" (archive) before, during and after the save process So... how can I check that a file is being written by any process ? Edited December 20, 2009 by lasaucisse [size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size] Link to comment Share on other sites More sharing options...
KaFu Posted December 10, 2009 Share Posted December 10, 2009 (edited) Take a look at the FileInUse function in my signature. Loop while it returns true to wait until writing has finished. Edit: I always add a pop-up with a looping progressbar and a timer check to the loop to set a certain timeout value. Edited December 10, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
lasaucisse Posted December 10, 2009 Author Share Posted December 10, 2009 Take a look at the FileInUse function in my signature. Loop while it returns true to wait until writing has finished.Edit: I always add a pop-up with a looping progressbar and a timer check to the loop to set a certain timeout value.thanks a lot !!! I'll try and come back [size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size] Link to comment Share on other sites More sharing options...
lasaucisse Posted December 10, 2009 Author Share Posted December 10, 2009 thanks a lot !!! I'll try and come back it works perfectly, thanks thanks thanks !!! [size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size] Link to comment Share on other sites More sharing options...
lasaucisse Posted December 11, 2009 Author Share Posted December 11, 2009 it's me again : how can I update the post's title with "resolved" or "done" ? [size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size] Link to comment Share on other sites More sharing options...
whim Posted December 11, 2009 Share Posted December 11, 2009 AFAIK you should be able to edit it from the 1st post whim Link to comment Share on other sites More sharing options...
lasaucisse Posted December 20, 2009 Author Share Posted December 20, 2009 (edited) done, thanks. Edited December 20, 2009 by lasaucisse [size="1"]mostly useless softwares (sorry for old VB softs ^^) & others things[/size] 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