Rizzet Posted February 10, 2007 Posted February 10, 2007 hi i need to see when a file is used.. and i found a dll function that probably do what i want, its in dl shell32 file named "SignalFileOpen" i dont realy now how to get it to work.. i did this and hope some1 could help me little with it While 1 Sleep(100) Select case DllCall("shell32.dll","none","SignalFileOpen", "str", "504881.wav") MsgBox(0, "test","works") Exit EndSelect WEnd the SignalFileOpen has a true/false return value
Rizzet Posted February 11, 2007 Author Posted February 11, 2007 (edited) did a new script but i still cant get it to work While 1 Sleep(10) $test = DllCall("C:\WINDOWS\system32\shell32.dll","none","SignalFileOpen", "str", "C:\Sound\504881.wav") if $test = true then Exit EndIf WEnd If someone know a better dll file for this or if this is totaly wrong plz tell me i would realy like to get this done Edited February 11, 2007 by Rizzet
PaulIA Posted February 11, 2007 Posted February 11, 2007 did a new script but i still cant get it to work While 1 Sleep(10) $test = DllCall("C:\WINDOWS\system32\shell32.dll","none","SignalFileOpen", "str", "C:\Sound\504881.wav") if $test = true then Exit EndIf WEnd If someone know a better dll file for this or if this is totaly wrong plz tell me i would realy like to get this doneTotally wrong. SignalFileOpen is used to notify the Shell that a file has been opened. And the paramater that is passed to it is not a string, it's a pointer to an item identifier list (PIDL). If you want to monitor files in a directory, you can take a look at the ReadDirectoryChangesW API. Auto3Lib: A library of over 1200 functions for AutoIt
Rizzet Posted February 11, 2007 Author Posted February 11, 2007 (edited) No i think i got right.. i want to know when an other program is using a specifik file.. opening it.. and i tryed PIDL but i still cant get it to work.. if someone could give me an example if an Function that works on the same way i would be vary thankfull ps: Sry for my bad english, i cant realy explain what i want. Edit: a does my script tell the shell that the file has been opened? ok and i want to know..so with this dll call im not doing anything:( Edited February 11, 2007 by Rizzet
Henke Posted February 11, 2007 Posted February 11, 2007 Hi, This is something that I'm already interested in knowing how to decide - i.e. if other processes have pointers (read or write) to a certain file... Regards, Henke
Rizzet Posted February 11, 2007 Author Posted February 11, 2007 (edited) Yes i have now been looking into BOOL ReadDirectoryChangesW( HANDLE hDirectory, LPVOID lpBuffer, DWORD nBufferLength, BOOL bWatchSubtree, DWORD dwNotifyFilter, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine ); and got this code Dim $str1 Dim $str2 $str1="504881.wav" $str2='' $res = DllCall("Kernel32.dll", "int", "ReadDirectoryChangesW","none", $str1, "ptr", $str2) MsgBox(0, "", "error: " & @error & @CRLF _ & "res: " & $res & @CRLF) with this new script i dont get dllcall error, now i just dont get an arrey on the $res and still an @error = 2 and sry for the $str1,$str2 etc when its not a string.. its mostly a copy to test it Edited February 11, 2007 by Rizzet
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