Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Shell Extensions for .NET Assemblies

, 17 Nov 2005
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";

[
	uuid(D57A5491-DE35-4566-936C-7EE0B4B4CEFB),
	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;
[
	uuid(B0C8ED7E-AAE0-4CE5-863D-E7D0D936E2D7),
	dual,
	object,
	nonextensible,
	oleautomation,
	pointer_default(unique),
	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);
};
[
	uuid(77BAD216-EFD7-43f9-922B-B4C802976858),
	lcid(0x0), // Neutral
	version(1.4),
	helpstring("Assembly Information Type Library")
]
library AsmShellLib
{
	importlib("stdole2.tlb");
	[
		uuid(0B95CAF4-642E-4D55-A265-432D64C4F62A),
		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.

License

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

Share

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 | Mobile
Web01 | 2.8.140926.1 | Last Updated 17 Nov 2005
Article Copyright 2002 by Heath Stewart
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid