matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: ImageElement + Internet
code: function _download(_path){
Interop.Call('urlmon', 'URLDownloadToFileW', 0, _path, _getTempFile(_getTempPath()), 0, 0);
}
function _getTempPath(){
var sBuffer = Interop.Allocate((100+1)*2);
Interop.Call('kernel32', 'GetTempPathW', 100, sBuffer);
return sBuffer.ReadString(0);
}
function getTempFile(_spath){
var sBuffer = Interop.Allocate((260+1)*2);
Interop.Call('kernel32', 'GetTempFileNameW', _spath, 'img', 0, sBuffer);
return sBuffer.ReadString(0);
}
|
|