473,385 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Generating thumbnails using IExtractImage

Hi

I am trying to get Windows Explorer to display thumbnails for my own
custom filetype. I have found plenty examples out there telling me how
to extract thumbnails from explorer for your own use, but I want to go
the other way around.

I have implemented the IExtractImage interface:

[ComImportAttribute()]
[GuidAttribute("BB2E617C-0920-11d1-9A0B-00C04FC2D6C1")]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceI sIUnknown)]
interface IExtractImage
{
void GetLocation(
[Out, MarshalAs(UnmanagedType.LPWStr)]
StringBuilder pszPathBuffer,
int cch,
ref int pdwPriority,
ref SIZE prgSize,
int dwRecClrDepth,
ref int pdwFlags);

void Extract(
out IntPtr phBmpThumbnail);
}

[Guid("907C0B30-CCDF-41f6-BBE3-C0DCB22BB2BC"), ComVisible(true)]
public class rageShellExtensions : IExtractImage, IShellExtInit
{
public rageShellExtensions() { }

const string clsid = "{907C0B30-CCDF-41f6-BBE3-C0DCB22BB2BC}";

void IExtractImage.GetLocation(
[Out, MarshalAs(UnmanagedType.LPWStr)]
StringBuilder pszPathBuffer,
int cch,
ref int pdwPriority,
ref SIZE prgSize,
int dwRecClrDepth,
ref int pdwFlags)
{
[Do something]
}

void IExtractImage.Extract(
out IntPtr phBmpThumbnail)
{
[Do something]

}
}

And I register myself with explorer as follows:

static public void Register()
{
Assembly asm = Assembly.GetExecutingAssembly();
RegistrationServices reg = new RegistrationServices();
reg.RegisterAssembly(asm,
AssemblyRegistrationFlags.SetCodeBase);
}

[System.Runtime.InteropServices.ComRegisterFunction Attribute()]
static void RegisterServer(String zRegKey)
{
try
{
RegistryKey root;
RegistryKey rk;

// For Winnt set me as an approved shellex
root = Registry.LocalMachine;
rk =
root.OpenSubKey("Software\\Microsoft\\Windows\\Cur rentVersion\\Shell
Extensions\\Approved", true);
rk.SetValue(clsid, "rageShellExtensions Shell
Extension");
rk.Close();

// Register for thumbnails
root = Registry.ClassesRoot;
rk =
root.CreateSubKey(".mtl\\shellex\\{BB2E617C-0920-11d1-9A0B-00C04FC2D6C1}");
rk.SetValue("", clsid);
rk.Close();
}
catch (Exception e)
{
[Handle bad things]
}
}
My problem is neither of my IExtractImage functions are getting called.
:( I've been googling all day and I'm stumped. Can anyone help me?

Thanks
Kevin

Jun 19 '06 #1
0 5474

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: c d saunter | last post by:
Greetings All, In Widows Explorer there is a thumbnail view, where you see images as thumbnails. Applications such as MS Office and OpenOffice, when installed, cause their respective filetypes to...
4
by: Rednelle | last post by:
Greetings all, As a newbie, using Access 2000, I would appreciate advice on the best way to include pictures. I have developed a 'Home Inventory' database which can include jpeg thumbnails of...
3
by: Vagabond Software | last post by:
I'm trying to display thumbnail images in a Listview that look more like the Windows thumbnail view. Everything is working pretty good, but my thumbnails are decidedly not like the Windows...
2
by: Keith Smith | last post by:
How can I have a box (maybe a picture box or a panel or something?) that will display all of the contents of a particular folder and show the picture files as thumbnails along with the name of the...
8
by: Fabricio Sperandio | last post by:
Hi everyone, I am trying to generate some thumbnails using System.Drawing.Image Class. Actually the GetThumnailImage method. The question is: How can I get a better thumbnail picture? I mean,...
6
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the...
1
by: Xah Lee | last post by:
The following is a program to generate thumbnail images for a website. Useful, if you want to do that. It is used to generate the thumbnails for my “Banners, Damsels, and Mores” project...
4
by: Barely Audible | last post by:
Guys I was wondering if it was possible to have a js file that, when the page loaded, it automatically generated a a set of thumbnails from directory of the page on the web server? Or would...
5
by: sejal17 | last post by:
Hello Friends, I want Application that displays an image preview of a Word document (Like thumbnail View of word document) Following is my code but i got error on bold part of code ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.