![]() The SetMenuHandler call has two parameters: The actual menu item object ( ToolStripMenuItem), and the name of a script block which will handle that menu item-in our case $Handle_OnStartup. ![]() We set the check mark on the menu item if the registry entry is there, otherwise, we make sure it’s off. Last but not least, there is code to construct two objects, a ToolStripSeparator and a ToolStripMenuItem, which we add to the menu.This connects a menu entry to a script block which gets called when a menu item is selected. Second, there is a call to $SAPIENHost.SetMenuHandler.It will just return $null if there is no context menu. The method GetContextMenuStrip exists in all hosts that have a $SAPIENHost object. NET type is ContextMenuStrip if you want to look that up. NET object for the tray application’s context menu. First, $SAPIENHost.GetContextMenuStrip() retrieves the.As you can see, there are only two calls here: The second part is the interaction with $SAPIENHost. ![]() If the items don’t match, we make sure to remove the entry-just in case you moved the application.
0 Comments
Leave a Reply. |