Game Development Reference
In-Depth Information
When an error occurs, it is the job of the following method to handle the error
gracefully.
protected abstract void HandleError(Exception exception);
Even though it's not necessarily used in our framework, we still need to implement
the IContextMenu.GetCommandString() method to a certain extent.
void IContextMenu.GetCommandString(int command,
uint flags,
int reserved,
StringBuilder commandString,
int max)
{
switch (flags)
{
case (uint)Native.GetCommandStringFlags.Verb:
{
commandString = new StringBuilder(“...”);
break;
}
case (uint)Native.GetCommandStringFlags.HelpText:
{
commandString = new StringBuilder(“...”);
break;
}
}
}
When our context menu extension initializes, we need to get a handle to the data
in the storage medium through the IDataObject interface. The following code
shows how to do this.
int IShellExtInit.Initialize(IntPtr folderPidl, IntPtr pointer, uint keyProgID)
{
try
{
if (pointer != IntPtr.Zero)
{
IDataObject dataObject = Marshal.GetObjectForIUnknown(pointer)
as IDataObject;
ClipFormat format = new ClipFormat();
Search Nedrilad ::




Custom Search