# \[FAQ\] .NET: Get the view you registered from an io.Connect window ID

**URL:** <https://community.interop.io/t/faq-net-get-the-view-you-registered-from-an-io-connect-window-id/607>\
**Category:** io.Connect Desktop\
**Tags:** NET\
**Created:** [November 9, 2026, 10:00pm UTC](https://community.interop.io/t/faq-net-get-the-view-you-registered-from-an-io-connect-window-id/607 "2026-11-09T22:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toni.petrov](https://yyz2.discourse-cdn.com/flex028/user_avatar/community.interop.io/toni.petrov/32/17_2.png) [@toni.petrov](https://community.interop.io/u/toni.petrov)\
**Post date:** [November 9, 2026, 10:00pm UTC](https://community.interop.io/t/faq-net-get-the-view-you-registered-from-an-io-connect-window-id/607/1 "2026-11-09T22:00:00Z")

</div>

### Q: A window event gives me a window ID. How do I get back the view object I registered?

If you register your own view (for example, a WinForms or WPF window) with `RegisterAppFactoryAsync` or `RegisterInstance`, it becomes an io.Connect window with an ID. Window events, such as focus changes, give you that ID. You often need the opposite: the original view object.

**Find the window**

To find any io.Connect window by ID, use `GetGDWindows()`:

```csharp
var targetWindowId = "29476_0";
IGDWindow[] allWindows = await io.GlueWindows.GetGDWindows();
IGDWindow targetWindow = allWindows.FirstOrDefault(window => window.Descriptor.Id == targetWindowId);

```

To search only your own app’s windows, use `GlueWindows.OwnWindows` ([io.Connect.NET](http://io.Connect.NET) 1.36.0 or later).

**Get the view ([io.Connect.NET](http://io.Connect.NET) 1.37.0 or later)**

From 1.37.0, the library stores the view you passed at registration on the window, under `StickyWindow.View`. Cast it to the type you registered:

```csharp
glue_.GlueWindows.SubscribeEvents<WindowFocusChangedEvent>(((@event, descriptor) =>
{
    if (glue_.GlueWindows.OwnWindows.FirstOrDefault(gdw => gdw.Id == descriptor.Id) is { } wnd)
    {
        var view = wnd.StickyWindow.View as Window;
        Debug.WriteLine($"{(@event.Data ? "got" : "lost")} focus: {@event.WindowId} with host {descriptor.ApplicationName}");
    }
}));

```

## References

- Window Management (.NET): [io.Connect Desktop Documentation - Windows \> Window Management \> .NET](https://docs.interop.io/desktop/capabilities/windows/window-management/net/index.html)
- App Management (.NET): [io.Connect Desktop Documentation - App Management \> .NET](https://docs.interop.io/desktop/capabilities/app-management/net/index.html)
