Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: intcontrol(39 intcontrol(40 intcontrol (39 intcontrol (40
When I execute the IntControl, it returns the last sharing state, but didn't seem to do anything else. Any ideas?
If is very rare that applications that have a file open for writing allow anyone else to look at it.
Here's an example of how to test whether a file is open, without causing a sharing violation
;---------------------------------------- file = "h:\test.xls" ;---------------------------------------- If FileItemize(file) == "" Message(file, "File does not exist") Exit Endif dll = DllLoad("krnl386.exe") DllCall(dll, word:"SetErrorMode", word:1) ; SEM_FAILCRITICALERRORS ofstruct = BinaryAlloc(150) hFile = DllCall(dll, word:"OpenFile", lpstr:file, lpbinary:ofstruct, word:16384) ; OF_EXIST errcode = BinaryPeek(ofstruct, 2) ofstruct = BinaryFree(ofstruct) DllFree(dll) If hFile == 65535 If errcode == 32 ; Sharing violation Message(file, "File is in use by another application") Else ; other error Message(file, "File could not be opened") Endif Exit Endif Message(file, "File is accessible")
Article ID: W13086
Filename: Intcontrol 39-40 and Share Violations.txt
File Created: 1999:04:15:16:51:40
Last Updated: 1999:04:15:16:51:40