Configuring Dynamic Positioning

You can host applications inside the ID, where the applications are treated as child windows and displayed as tabs. CCF uses the SetParent method to set the application’s root window as the child window of ID. However, you cannot use the SetParent method for some applications (For example, WinForms 1.1 MDI applications). You can use Dynamic Positioning for these applications and host them as child windows inside the ID. Dynamic Positioning monitors the size and position of ID and dynamically adjust the size and position of the application. While hosting applications with windows that are not resizable, ensure that you set the set the minimum size property of the application. For more information about setting application properties, see Managing Hosted Applications.

Note

Due to limitations with the Dynamic Positioning functionality, while ID is in the background clicking on dynamically positioned application brings the application into foreground instead of ID.

Configuring Dynamic Positioning for an External Application

To configure Dynamic Positioning for an external application:

  1. Open the Admin Console and expand the computer node.

  2. Open the Hosted Applications node.

  3. Double-click the hosted application for which you want to configure dynamic positioning. This opens the Properties page.

  4. Click the Build button.

  5. In the Application Hosting section of the Build window, select Use Dynamic Positioning. Select Attach Input Thread if you want attach the input queues of ID and the host application windows. When you attach the input queues, ID and the host applications share the UI state. By sharing the UI state, the response time of ID is dependent on the response time of the hosted application. Selecting the option adds the tag <NoAttachThreadInput> to the initstring of the hosted application.

  6. Dd632636.bf2db403-750c-4bbd-8acb-caed3d13ca09(en-us,TechNet.10).png

  7. While hosting Windows external applications in a WPF ID, it is recommended that you select Attach Input Thread. This improves the performance of the dynamically hosted windows external application.

  8. Click OK.

  9. Optionally, in the Properties window edit the initstring to add the following entries:

    • <RetainFrameAndCaption>: Adding this tag will retain the frame and caption of the hosted application.

    • <RetainOnTaskbar>: Adding this tag will display the external application in the Windows taskbar.

    • <RetainSystemMenu>: Adding this tag will retain the system menu of the hosted application.

    • <RestoreIfMinimized> : The tag restores the application window to normal state if its default state is minimized

    • <RemoveSizingControls>: The tag removes the Minimize and Maximize buttons from the application window’s title bar.

    • <RemoveSizingMenu>: The tag removes the Maximize, Minimize, Size, and Move command from the control-menu box of the application.

    • <initstring>
        <interopAssembly>
          <hostOnTop>
            <NoAttachThreadInput />
            <RetainFrameAndCaption />
            <RetainOnTaskbar />
            <RetainSystemMenu />
          </hostOnTop>
          <URL>%windir%\system32\Application.exe</URL>
          <WorkingDirectory>%windir%\system32</WorkingDirectory>
      </interopAssembly>
      
  10. Note

    You can disable a tag by adding underscore at the beginning of each of the tags. For example, to disable the <RetainSystemMenu> tag it should be renamed to <_RetainSystemMenu>.

  11. Close the Properties window.

Configuring Dynamic Positioning for a Web Application

To configure Dynamic Positioning for a web application:

  1. Open the Admin Console and expand the computer node.

  2. Open the Hosted Applications node.

  3. Double-click the web application for which you want to configure dynamic positioning. This opens the Properties page.

  4. Click the Build button.

  5. In the Application Hosting section of the Build window, select Use Dynamic Positioning.

  6. Dd632636.39a265ef-f6a1-43ee-ae57-3f87c2baf98d(en-us,TechNet.10).png

  7. Click OK.

  8. The initstring in the Properties window is updated with the tag <hostOnTop />. You can configure the dynamically positioned window by using the following tags inside in the <hostOnTop /> tag:

    • <RetainFrameAndCaption>: Adding this tag will retain the frame and caption of the hosted application.
    • <RetainOnTaskbar>: Adding this tag will display the external application in the Windows taskbar.
    • <RetainSystemMenu>: Adding this tag will retain the system menu of the hosted application.
    • <RestoreIfMinimized> : The tag restores the application window to normal state if its default state is minimized.
    • <RemoveSizingControls>: The tag removes the Minimize and Maximize buttons from the application window’s title bar.
    • <RemoveSizingMenu>: The tag removes the Maximize, Minimize, Size, and Move command from the control-menu box of the application.
  9. Following is an example of the initstring:

  10. <?xml version="1.0" encoding="utf-16"?>
      <initstring>
        <homePage>https://www.bing.com</homePage>
        <hostOnTop>
          <RemoveSizingMenu>
          <RestoreIfMinimized>
        </hostOnTop>
        <adapter>
        <URL>Microsoft.Ccf.HostedApplicationToolkit.AutomationHosting</URL>
        <type>Microsoft.Ccf.HostedApplicationToolkit.AutomationHosting.AutomationAdapter</type>
        </adapter>
    
      <DataDrivenAdapterBindings>
        <Type>Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter.WebDataDrivenAdapter, Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter</Type>
          <Controls />
      </DataDrivenAdapterBindings>
    </initstring>
    
  11. Close the Properties window.