Use custom commands embedded in the Microsoft Lync 2010 UI to launch applications on the Windows desktop.
Custom commands are menu items added by the developer to the Lync 2010 UI.
Adding Custom Commands
To add a custom command for an application, add a registry subkey and the registry entries described in this section.
Registry Subkey
The subkey is the application GUID, added at one of the following locations:
-
For 64-bit operating systems: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Communicator\SessionManager\Apps
-
For 32-bit operating systems: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Communicator\SessionManager\Apps
Registry Entries
Under each GUID subkey, add the entries described in the following table.
Entry |
Type |
Description |
---|---|---|
Name |
REG_SZ |
Name of the application as it appears in the Lync 2010 UI. |
Path |
REG_SZ |
Full path of the application along with parameters, including the default parameters of %user-id% and %contact-id%. The parameters pass a String representing the SIP URI of the user signed into Lync 2010 and the selected contact or contacts, to the application launched. |
ApplicationType |
DWORD |
0 = Executable, 1 = Protocol. |
ApplicationInstallPath |
REG_SZ |
Full path of the executable. Required if ApplicationType is 0. |
SessionType |
DWORD |
|
ExtensibleMenu |
REG_SZ |
A semicolon-delimited list of places where the command appears. Possible values are: MainWindowActions, MainWindowRightClick, ConversationWindowActions, ConversationWindowRightClick; ContactCardMenu. If ExtensibleMenu is not defined, the default values of MainWindowRightClick and ConversationWindowActions are used. |
For example, see the following Registry Editor (.REG) file results.
Copy Code | |
---|---|
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Communicator\SessionManager\Apps\{3E0352E8-21F3-4E00-AA46-2ADA7085C9AD}] "Name"="Contoso Custom Application" "ApplicationType"=dword:00000000 "ApplicationInstallPath"="C:\\ExtApp1.exe" "Path"="C:\\ExtApp1.exe %user-id% %contact-id%" "SessionType"=dword:00000000 "ExtensibleMenu"="ConversationWindowRightClick;ContactCardMenu;MainWindowRightClick" |
Using Custom Commands
The following table describes how to launch an application with a given ExtensibleMenu value.
ExtensibleMenu value |
Action |
---|---|
MainWindowActions |
On the Lync 2010 Titlebar, click the down arrow, point to Tools, and then click the custom command. |
MainWindowRightClick |
Right-click a contact in the Contact Listor Search Resultspane, and then click the custom command. |
ConversationWindowActions |
In the Conversationwindow Titlebar, click the Menubutton, point to Actions, and then click the custom command. |
ConversationWindowRightClick |
In the Conversationwindow People Optionsmenu, activate Show Participant List, right-click a contact name, and then click the custom command. |
ContactCardMenu |
Click the custom command in the contact card Optionsmenu. |
Retrieving SIP URIs in the Custom Application
To retrieve the %user-id% and %contact-id% arguments, add code to the application launched by the custom command. See the following sample code.
Copy Code | |
---|---|
static void Main(string[] args) { if (null == args || args.Length == 0) { Console.WriteLine("Args is empty"); } else { foreach (string arg in args) { Console.WriteLine("Arg: " + arg); } } Console.ReadLine(); } |
Removing Custom Commands
Removing the GUID subkey removes the appropriate custom commands from the Lync 2010 UI.