Game Development Reference
The StorageMedium structure defined below is known as STGMEDIUM in the unmanaged
world. It is a generalized global memory handle used in data transfer operations
like IDataObject.GetData() .
public struct StorageMedium
public uint Medium;
public uint Global;
public uint ReleasePointer;
There are some enumerated values that must also be defined in order for the
unmanaged interfaces and methods to operate. These types are defined in an
internal class called Native so that they are not accessible outside of the assembly.
internal sealed class Native
The following flags enumeration is used to determine when a context menu
should be shown. There are many more flags that can be used as a filter, but this
chapter only focuses on one flag, so the rest have been truncated out. The Explore
flag ( CMF_EXPLORE ) will be set when the context menu is being generated by the shell
from an Explorer mode window.
internal enum QueryContextMenuFlags : uint
Explore = 0x00000004
When one of the items added by a context menu extension is highlighted, the
IContextMenu.GetCommandString() method is called to request a help text string or a
verb string assigned to the command (canonical). Both ANSI and Unicode strings
can be requested. This functionality is generally used for localization and will not
be covered in this chapter. Feel free to consult MSDN for more information.
internal enum GetCommandStringFlags : uint
Verb = 0x00000000, // Canonical verb
HelpText = 0x00000001 // Help text (for status bar)
The following flags enumeration is used when specifying the data format for
IDataObject . There are many more format types available, but this chapter only