From b2b7d4c442dffc518f0f29d3fabb9c06ea9c4229 Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Tue, 5 Jul 2016 18:29:22 -0400 Subject: on_window_open(userdata ShiftOSDesktop, string) and on_window_close(userdata ShiftOSDesktop, string) now report window GUIDs to their handlers instead of userdata Form objects. You can now use get_window(string) to get a Form from a window GUID. --- source/WindowsFormsApplication1/API.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/WindowsFormsApplication1/API.cs') diff --git a/source/WindowsFormsApplication1/API.cs b/source/WindowsFormsApplication1/API.cs index f952a18..2fe6126 100644 --- a/source/WindowsFormsApplication1/API.cs +++ b/source/WindowsFormsApplication1/API.cs @@ -82,7 +82,8 @@ namespace ShiftOS public class API { - + public static Dictionary OpenGUIDs = new Dictionary(); + /// /// Settings file. /// @@ -1188,6 +1189,7 @@ namespace ShiftOS } })); WindowComposition.SafeToAddControls = true; + API.OpenGUIDs.Add(formToCreate, Guid.NewGuid().ToString()); API.CurrentSession.Invoke(new Action(() => { CurrentSession.InvokeWindowOp("open", formToCreate); })); }; bw.RunWorkerAsync(); -- cgit v1.2.3