// script "LA floating panel make unowned.cs"
LA.FloatingPanelMakeUnowned("Recipe");
//LA.FloatingPanelMakeUnowned("*"); //all
static class LA {
/// <summary>
/// Finds a LA floating panel and makes it not owned by the main LA window.
/// </summary>
/// <param name="name">Panel name. Or <c>"*"</c> for "all panels".</param>
/// <remarks>
/// Then the panel is not always on top of the main LA window. It is visible when the main window is minimized. It can be maximized and minimized, and has a taskbar button.
/// </remarks>
public static void FloatingPanelMakeUnowned(string name) {
foreach (var w in wnd.findAll("Au.Editor - " + name, "HwndWrapper[Au.Editor;*", default, WFlags.CloakedToo, also: o => o.HasExStyle(WSE.TOOLWINDOW) && !o.HasStyle(WS.CAPTION))) {
FloatingPanelMakeUnowned(w);
}
}
/// <summary>
/// Makes a LA floating panel not owned by the main LA window.
/// </summary>
/// <param name="w">Floating panel window.</param>
public static void FloatingPanelMakeUnowned(wnd w) {
WndUtil.SetOwnerWindow(w, default);
w.SetExStyle(WSE.TOOLWINDOW, WSFlags.Remove);
w.SetStyle(WS.CAPTION | WS.MAXIMIZEBOX | WS.MINIMIZEBOX | WS.SYSMENU, WSFlags.Add | WSFlags.UpdateNonclient);
api.EnableMenuItem(api.GetSystemMenu(w, false), api.SC_CLOSE, api.MF_GRAYED);
w.TaskbarButton.Add();
}
unsafe class api : NativeApi {
[DllImport("user32.dll")]
internal static extern IntPtr GetSystemMenu(wnd hWnd, bool bRevert);
[DllImport("user32.dll")]
internal static extern bool EnableMenuItem(IntPtr hMenu, uint uIDEnableItem, uint uEnable);
internal const uint SC_CLOSE = 0xF060;
internal const uint MF_GRAYED = 0x1;
}
}
[split] LA floating panels - option to make not always on top of the main window
|
|
« Next Oldest | Next Newest »
|
Messages In This Thread |
[split] LA floating panels - option to make not always on top of the main window - by Davider - 04-26-2024, 11:31 PM
RE: [split] LA floating panels - option to make not always on top of the main window - by Gintaras - 04-27-2024, 04:30 AM
RE: [split] LA floating panels - option to make not always on top of the main window - by Davider - 04-27-2024, 09:21 AM
RE: [split] LA floating panels - option to make not always on top of the main window - by Gintaras - 06-30-2024, 07:51 AM
|
Users browsing this thread: 1 Guest(s)