Reputation: 21
I am trying to over come the non responsive nature of file copy implemented using autohotkey.
I am trying to do this though Dllcall() to CopyFileEx() function in Kernel32.dll.
Following is the C++ interface of CopyFileEx() function, but i have no idea how to make it work with autohotkey script.
BOOL WINAPI CopyFileEx(
In LPCTSTR lpExistingFileName,
In LPCTSTR lpNewFileName,
_In_opt_ LPPROGRESS_ROUTINE lpProgressRoutine,
_In_opt_ LPVOID lpData,
_In_opt_ LPBOOL pbCancel,
In DWORD dwCopyFlags
);
Thanks for the help in advance :)
Upvotes: 1
Views: 460
Reputation: 21
http://www.autohotkey.com/board/topic/20790-copyfileex-dllcall-and-registercallback
file1:="movetest.exe" file2:="movetest2.exe"
address :=registercallback("update") dllcall("CopyFileEx",str,file1,str,file2,Uint,address,Uint,0,int,0,int,0)
return
Esc::ExitApp update(var1lo,var1hi,var2lo,var2hi,var3lo,var3hi,var4lo,var4hi,var5,var6,var7,var8,var9){ progress,% (var2lo/var1lo) * 100,,% (var2lo/var1lo) * 100 " %",copying file return 0 }
The link above is exactly what i needed. Someone on the autohotkey forum posted the answer, thought I would also share it with you guys.
Upvotes: 1