Interacting with the SharePoint Workspace Process

Applies to: SharePoint Workspace 2010 | Visual Studio 2008

In order for SharePoint Workspace to respond to Groove Web Service requests, the SharePoint Workspace process must be running. To avoid errors, your application can check if the SharePoint Workspace process is running. If SharePoint Workspace is not running, your application can either launch SharePoint Workspace or display a message to the user.

For all operations other than GrooveAccounts Read2, the user must be logged into SharePoint Workspace. In Groove 2007, it was possible for the application to be running without the user being logged into the application. In SharePoint Workspace, this situation does not occur.

Many Groove Web Services operations can cause the SharePoint Workspace process to display a window. The GrooveLocal service operations can explicitly request the window. When SharePoint Workspace displays the window, it may not be able to set the foreground window. Consequently, the user may not see the window. To avoid this problem, your application can call the Windows AllowSetForegroundWindow() method specifying GROOVE.EXE process ID as a parameter. When the SharePoint Workspace application starts, it stores its process ID in the GrooveLocalHTTPServerPID registry key.

The following C# code fragment demonstrates how to use the GrooveLocalHTTPServerPID registry key and the AllowSetForegroundWindow function to allow SharePoint Workspace to set the foreground window.

using System.Runtime.InteropServices;
...
public class Form1 : System.Windows.Forms.Form
{
  [DllImport("user32")] public static extern bool 
  AllowSetForegroundWindow(int dwProcessId);
  public Form1()
  {
    //
    // Required for Windows Form Designer support
    //
    InitializeComponent();

    //
    // TODO: Add any constructor code after InitializeComponent call
    //
    string groovePIDString = … // Read from registry);
    int groovePID = Int32.Parse(groovePIDString);
    AllowSetForegroundWindow(groovePID);
  }
}

SharePoint Workspace tracks user awareness information, which includes whether users are online, active, currently using a workspace, or currently using a tool. SharePoint Workspace judges whether a user is active by the user's interaction with the user interface. If a user is interacting with a Groove Web Services application exclusively, the user will always appear to be inactive. However, the application can specify that the user is in a workspace or tool by calling the GrooveMembersEnterSpace and EnterTool operations. In addition, to providing awareness information, the EnterSpace operation increases the priority of performing any data changes that are initiated by other users. Consequently, an application should use the EnterSpace and ExitSpace operation to ensure that the SharePoint Workspace application gives priority to updating the data in the workspaces that the user is accessing in the Web Services application.

See Also

Concepts

Programming Practices for Groove Web Services

Reading Groove Web Services Registry Keys