What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Get File Properties

Pages: (2): « First « 1 [ 2 ] Last »
Get File Properties
Author: Message:
wincy
Junior Member
**


Posts: 67
Reputation: 4
35 / Male / Flag
Joined: Feb 2008
O.P. RE: RE: Get File Properties
quote:
Originally posted by matty
Ok you need to review a bit about memory allocations.

js code:
var szDisplayName = Interop.Allocate(512);
var szTypeName= Interop.Allocate(162);
var SHFILEINFO = Interop.Allocate(18);

with ( SHFILEINFO ) {
    WriteDWORD(10, szDisplayName.DataPtr);
    WriteDWORD(14, szTypeName.DataPtr);
}

Debut.Trace( 'ShGetFileInfoW : ' + Interop.Call('shell32', 'ShGetFileInfoW', 'C:\\antivir.exe', 0x80, SHFILEINFO.DataPtr, 0x800 ) === 0 ? 'Passed' : 'Failed' );

And obviously I have no way of testing the above it is just a guideline... but do research a bit more.


(You wrote "Debut.Trace") It is failing for some reason, it is not specified why... (error code: 2147352567 on "Debug.Trace" line) :S
It gives error also using this only:

Interop.Call('shell32', 'ShGetFileInfoW', 'C:\\antivir.exe', 0x80, SHFILEINFO.DataPtr, 0x800);

This post was edited on 02-18-2009 at 06:30 PM by wincy.
02-18-2009 06:21 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Get File Properties
I fixed it, I was missing the Size parameter.
02-18-2009 06:47 PM
Profile E-Mail PM Find Quote Report
wincy
Junior Member
**


Posts: 67
Reputation: 4
35 / Male / Flag
Joined: Feb 2008
O.P. RE: RE: Get File Properties
quote:
Originally posted by matty
I fixed it, I was missing the Size parameter.
Do I have to put file size in there (either manually or with a function)?
I really thank you for you patience, Matty.
It still gives the same error (in Interrop.Call), even using this:

var szDisplayName = Interop.Allocate(512);
var szTypeName= Interop.Allocate(162);
var SHFILEINFO = Interop.Allocate(18);

with(SHFILEINFO){
    WriteDWORD(10, szDisplayName.DataPtr);
    WriteDWORD(14, szTypeName.DataPtr);
    Interop.Call('shell32', 'ShGetFileInfoW', 'C:\antivir.exe', 0x80, SHFILEINFO.DataPtr, Size, 0x800);
}


Try the attachment (just change file path)

.plsc File Attachment: Test.plsc (618 bytes)
This file has been downloaded 117 time(s).

This post was edited on 02-18-2009 at 06:59 PM by wincy.
02-18-2009 06:58 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Get File Properties
You cannot use a single \ in JScript. I told you that earlier...
02-18-2009 07:03 PM
Profile E-Mail PM Find Quote Report
wincy
Junior Member
**


Posts: 67
Reputation: 4
35 / Male / Flag
Joined: Feb 2008
O.P. RE: Get File Properties
Sorry, it was just a try, but the error wasn't that. Did you tested it?

Edit: Ok, it was ShGetFileInfoW instead of SHGetFileInfoW.
Now code seems to be correct, but for some reason Debug says:
"ShGetFileInfoW : Failed"

This post was edited on 02-18-2009 at 07:23 PM by wincy.
02-18-2009 07:19 PM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Get File Properties
No I didn't I will have to try when I get home.
02-18-2009 07:32 PM
Profile E-Mail PM Find Quote Report
wincy
Junior Member
**


Posts: 67
Reputation: 4
35 / Male / Flag
Joined: Feb 2008
O.P. RE: Get File Properties
I'm sure that file path is correct.
If i don't have to change anything else on code, i really don't know why it doesn't works.
Please answer here if you find errors or a solution.

If i will succeed in making all script works I'll put a thanks to you on it!
Thanks in advance for all! :)
02-18-2009 07:42 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On