Context Menu Handler Interfaces
The components we will write in this book will all implement any given number of system interfaces. “System” in this context (no pun intended) means that these interfaces have already been defined by Microsoft. They are documented, and you can read all about them in the Platform SDK (though the details may be a little murky sometimes).
You can think of an interface
as a defined functionality. When a component
implements an interface, it is really saying,
“I support this functionality!” Consider a Triangle
component. It implements the interface Shape.
Shape defines two methods: Draw
and Color. Therefore, you could expect to access
the following functionality through Triangle:
Triangle.Draw Triangle.Color
Because the Circle, Square, and Trapezoid components
also implement Shape, you
would expect these objects to have the same functionality as well.
This is what it means to implement an interface.
The components in this book all implement some functionality that is required by the shell. This means that when the shell loads our components, it will be able to gain access to our component through a defined mechanism: an interface.
With that said, let’s talk about the interfaces a context menu handler component needs to implement before it can be loaded by the shell.
IShellExtInit
IShellExtInit
contains one method (besides the IUnknown portion
of the interface), Initialize, as shown in Table 4.1.
Table 4-1. IShellExtInit
|
Method |
Description |
|---|---|
|
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access