Click or drag to resize

ShellUtilitiesExtractMenu Method (String, ActionShellMenuItem, ShellMenuItem, Boolean)

Runs an action on all menu items from a shell item's context menu.

Namespace:  ShellBoost.Core.Utilities
Assembly:  ShellBoost.Core (in ShellBoost.Core.dll) Version: 1.8.3.0
Syntax
C#
public static int ExtractMenu(
	string path,
	Action<ShellMenuItem, ShellMenuItem> action,
	bool throwOnError = true
)

Parameters

path
Type: SystemString
The shell item's path.
action
Type: SystemActionShellMenuItem, ShellMenuItem
The action to run. First parameter is the current item's parent (which can be null for top level items), second parameter is the current item.
throwOnError (Optional)
Type: SystemBoolean
true to throw error; otherwise false.

Return Value

Type: Int32
0 or an error code.
Exceptions
ExceptionCondition
ArgumentNullException path or action
ArgumentExceptionpath or action is null.
Remarks
This method behavior depends on many contextual parameters such as the process bitness (32 or 64 bit), the type of process (Console vs Windows), or the the current thread's COM apartment state (STA vs MTA, etc.). It also depends on how dynamic context menu handlers choose to add or not menu items.
See Also