public void TestGetClassname() { var desktopHandle = InteropWindowQuery.GetDesktopWindow(); var classname = User32Api.GetClassname(desktopHandle.Handle); Assert.Equal("#32769", classname); }
/// <summary> /// Get the Windows class name /// </summary> /// <param name="interopWindow">InteropWindow</param> /// <param name="forceUpdate">set to true to make sure the value is updated</param> /// <returns>string with the classname</returns> public static string GetClassname(this IInteropWindow interopWindow, bool forceUpdate = false) { if (interopWindow.Classname == null || forceUpdate) { var className = User32Api.GetClassname(interopWindow.Handle); interopWindow.Classname = className; } return(interopWindow.Classname); }