Click here to Skip to main content
11,505,005 members (68,114 online)
Click here to Skip to main content
Add your own
alternative version

Shell Extensions for .NET Assemblies

, 17 Nov 2005 Ms-PL 138K 2.4K 80
Shell extensions to distinguish between .NET assemblies and Win32 applications and libraries.
// AsmShell.idl : IDL source for AsmShell

// This file will be processed by the MIDL tool to
// produce the type library (AsmShell.tlb) and marshalling code.

import "oaidl.idl";
import "ocidl.idl";

	helpstring("The file types supported by this library.")
typedef enum FileType
	[helpstring("Win32 Executable (x86)")] Win32Executable,
	[helpstring("Win32 Library (x86)")] Win32Library,
	[helpstring(".NET Executable (x86)")] DotNETExecutable,
	[helpstring(".NET Library (x86)")] DotNETLibrary,
	[helpstring(".NET Module (x86)")] DotNETModule,
	[helpstring("Win64 Executable (ia64)")] Win64ExecutableIA64,
	[helpstring("Win64 Library (ia64)")] Win64LibraryIA64,
	[helpstring(".NET Executable (ia64)")] DotNETExecutableIA64,
	[helpstring(".NET Library (ia64)")] DotNETLibraryIA64,
	[helpstring(".NET Module (ia64)")] DotNETModuleIA64,
	[helpstring("Win64 Executable (x64)")] Win64ExecutableX64,
	[helpstring("Win64 Library (x64)")] Win64LibraryX64,
	[helpstring(".NET Executable (x64)")] DotNETExecutableX64,
	[helpstring(".NET Library (x64)")] DotNETLibraryX64,
	[helpstring(".NET Module (x64)")] DotNETModuleX64,
	[helpstring("Other")] Other = -1
} FileType;
	helpstring("IAssemblyInfo Interface")
interface IAssemblyInfo : IDispatch{
	[id(1), helpstring("Determines whether a given file is a .NET assembly.")]
	HRESULT IsAssembly([in] BSTR path, [out, retval] VARIANT_BOOL* retVal);
	[id(2), helpstring("Gets the file type for the file.")]
	HRESULT GetFileType([in] BSTR path, [out,retval] FileType* retVal);
	[id(3), helpstring("Gets the public key token for the assembly.")]
	HRESULT GetPublicKeyToken([in] BSTR path, [out,retval] BSTR* retVal);
	[id(4), helpstring("Gets the public key for the assembly.")]
	HRESULT GetPublicKey([in] BSTR path, [out,retval] SAFEARRAY(BYTE)* retVal);
	lcid(0x0), // Neutral
	helpstring("Assembly Information Type Library")
library AsmShellLib
		helpstring("AssemblyInfo Class")
	coclass AssemblyInfo
		[default] interface IAssemblyInfo;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Heath Stewart
Program Manager Microsoft
United States United States
Heath Stewart is a happily married software engineer originally from the Midwest and a graduate of Iowa State University. Heath start programming early in life and enjoys continuous research and development in new languages, frameworks, and platforms. Fluent in many different programming languages, he has developed many large-scale software solutions for companies in different areas, such as Internet filtering, intrusion detection systems, production management systems, and web applications for various purposes. He also enjoys photography.

Currently, Heath is a Program Manager in the Visual Studio Professional Deployment Experience (VSPro DEX) team at Microsoft. Previous to his employment, he was a Microsoft MVP for Visual C#.

He is also a CodeProject protector and is happy to help the development community.
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 17 Nov 2005
Article Copyright 2002 by Heath Stewart
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid