Using Shell32 to read thumbs.db

Blitz3D Forums/Blitz3D Programming/Using Shell32 to read thumbs.db

Sacha(Posted 2009) [#1]
Hello there.
I recently started using external dlls & decls, and would like to use a new one but im not at ease with that.

I seek help and guidance on how to use either IExtractIcon or SHGetFileInfo or whatever more appriopriate to read a thumbnail generated by windows and stored in thumbs.db

Basically, Im already stuck at the first step : how to declare those calls (or functions or whatever its called) in the Userlibs decls.

Hope you'll be able to help me with this. :x


jfk EO-11110(Posted 2009) [#2]
I'd suggest you take an example from the archives that contains some decls, eg. this:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1661

The decls files must be copied to the userlibs folder. Parameters may be variables (%,$..) or pointers(*), where a blitz bank handle can be used for Pointers (in the call within blitz). If your declaration is not the same as the original function name then you have to declare it this way:

RtlMoveMemory2%(Destination*,Source,Length) : "RtlMoveMemory"

So at the end of the line is the original funtion name. THis way you can use one function with various parameter settings.

Microsoft offer several developer infos for every system function, just use a seach engine.


Sacha(Posted 2009) [#3]
Thank for your suggestions, but I kinda got this part. However where Im lost is :
- what are LPCTSTR pszPath, SHFILEINFO *psfi" and how to declare that, and when a call has different methods (like something.method1, something.method2) how to declare that ?

When you're mentioning "Microsoft offer several developer infos for every system function, just use a seach engine. " ... I assume you're talking about MSDN, which I linked twice in my original post ? I know how to use a search engine, sir. : )


Warner(Posted 2009) [#4]
Something with LP is usually a pointer, you can use the pointer that CreateBank returns for that.
*psfi should be an object, if I remember correctly, you can probl. use a bank for that, too.
If a function has multiple methods, you can declare both under another name. After the function declaration in the .decls file, there is a double point, followed by the function's "real name" in the dll between quotes.
.lib "example.dll"

Something_method1(one$): "Something"
Something_method2(one$, two$) : "Something"



Guy Fawkes(Posted 2009) [#5]
Just b/c I know the feeling of not bein able to do somethin, I'm gonna release my user32, shell32, & winmm libs for ya :) It should have what u want & more ^^

user32.decls:


shell32.decls:


winmm.decls:


Good luck on your project! ^^

~DS~


Sacha(Posted 2009) [#6]
Great, thanks you two for the explanation and source :D
I should be able to do what I wanted with this. : )


Guy Fawkes(Posted 2009) [#7]
Hey mate, no prob :) It's what we're here for! :) You need source in order to learn, right? ^^ Well there ya go ^^

~DS~