mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Added Comments (3)
Auto gen by mono
This commit is contained in:
parent
ed5c1d67d2
commit
25376da8de
1 changed files with 128 additions and 3 deletions
|
@ -33,24 +33,53 @@ using System.Diagnostics;
|
|||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
/// <summary>
|
||||
/// Coherence commands.
|
||||
/// </summary>
|
||||
namespace ShiftOS.WinForms
|
||||
{
|
||||
[Namespace("coherence")]
|
||||
[RequiresUpgrade("kernel_coherence")]
|
||||
public static class CoherenceCommands
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the window position.
|
||||
/// </summary>
|
||||
/// <returns>The window position.</returns>
|
||||
/// <param name="hWnd">H window.</param>
|
||||
/// <param name="hWndInsertAfter">H window insert after.</param>
|
||||
/// <param name="X">X.</param>
|
||||
/// <param name="Y">Y.</param>
|
||||
/// <param name="cx">Cx.</param>
|
||||
/// <param name="cy">Cy.</param>
|
||||
/// <param name="uFlags">U flags.</param>
|
||||
[DllImport("user32.dll")]
|
||||
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
|
||||
|
||||
/// <summary>
|
||||
/// The HWN d TOPMOS.
|
||||
/// </summary>
|
||||
static readonly IntPtr HWND_TOPMOST = new IntPtr(-1);
|
||||
|
||||
/// <summary>
|
||||
/// The SW p SHOWWINDO.
|
||||
/// </summary>
|
||||
const UInt32 SWP_SHOWWINDOW = 0x0040;
|
||||
|
||||
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
/// <summary>
|
||||
/// Gets the window rect.
|
||||
/// </summary>
|
||||
/// <returns>The window rect.</returns>
|
||||
/// <param name="hWnd">H window.</param>
|
||||
/// <param name="lpRect">Lp rect.</param>
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect);
|
||||
|
||||
/// <summary>
|
||||
/// REC.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT
|
||||
{
|
||||
|
@ -62,6 +91,11 @@ namespace ShiftOS.WinForms
|
|||
|
||||
[Command("launch", "process: \"C:\\path\\to\\process\" - The process path to launch.", "Launch a process inside kernel coherence.")]
|
||||
[RequiresArgument("process")]
|
||||
/// <summary>
|
||||
/// Launchs the app.
|
||||
/// </summary>
|
||||
/// <returns>The app.</returns>
|
||||
/// <param name="args">Arguments.</param>
|
||||
public static bool LaunchApp(Dictionary<string, object> args)
|
||||
{
|
||||
string process = args["process"].ToString();
|
||||
|
@ -70,6 +104,11 @@ namespace ShiftOS.WinForms
|
|||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the coherence.
|
||||
/// </summary>
|
||||
/// <returns>The coherence.</returns>
|
||||
/// <param name="prc">Prc.</param>
|
||||
private static void StartCoherence(Process prc)
|
||||
{
|
||||
RECT rct = new RECT();
|
||||
|
@ -93,26 +132,112 @@ namespace ShiftOS.WinForms
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The W s BORDE.
|
||||
/// </summary>
|
||||
const int WS_BORDER = 8388608;
|
||||
|
||||
/// <summary>
|
||||
/// The W s DLGFRAM.
|
||||
/// </summary>
|
||||
const int WS_DLGFRAME = 4194304;
|
||||
|
||||
/// <summary>
|
||||
/// The W s CAPTIO.
|
||||
/// </summary>
|
||||
const int WS_CAPTION = WS_BORDER | WS_DLGFRAME;
|
||||
|
||||
/// <summary>
|
||||
/// The W s SYSMEN.
|
||||
/// </summary>
|
||||
const int WS_SYSMENU = 524288;
|
||||
|
||||
/// <summary>
|
||||
/// The W s THICKFRAM.
|
||||
/// </summary>
|
||||
const int WS_THICKFRAME = 262144;
|
||||
|
||||
/// <summary>
|
||||
/// The W s MINIMIZ.
|
||||
/// </summary>
|
||||
const int WS_MINIMIZE = 536870912;
|
||||
|
||||
/// <summary>
|
||||
/// The W s MAXIMIZEBO.
|
||||
/// </summary>
|
||||
const int WS_MAXIMIZEBOX = 65536;
|
||||
|
||||
/// <summary>
|
||||
/// The GW l STYL.
|
||||
/// </summary>
|
||||
const int GWL_STYLE = -16;
|
||||
|
||||
/// <summary>
|
||||
/// The GW l EXSTYL.
|
||||
/// </summary>
|
||||
const int GWL_EXSTYLE = -20;
|
||||
|
||||
/// <summary>
|
||||
/// The W s E x DLGMODALFRAM.
|
||||
/// </summary>
|
||||
const int WS_EX_DLGMODALFRAME = 0x1;
|
||||
|
||||
/// <summary>
|
||||
/// The SW p NOMOV.
|
||||
/// </summary>
|
||||
const int SWP_NOMOVE = 0x2;
|
||||
|
||||
/// <summary>
|
||||
/// The SW p NOSIZ.
|
||||
/// </summary>
|
||||
const int SWP_NOSIZE = 0x1;
|
||||
|
||||
/// <summary>
|
||||
/// The SW p FRAMECHANGE.
|
||||
/// </summary>
|
||||
const int SWP_FRAMECHANGED = 0x20;
|
||||
|
||||
/// <summary>
|
||||
/// The M f BYPOSITIO.
|
||||
/// </summary>
|
||||
const uint MF_BYPOSITION = 0x400;
|
||||
|
||||
/// <summary>
|
||||
/// The M f REMOV.
|
||||
/// </summary>
|
||||
const uint MF_REMOVE = 0x1000;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the window long.
|
||||
/// </summary>
|
||||
/// <returns>The window long.</returns>
|
||||
/// <param name="hWnd">H window.</param>
|
||||
/// <param name="nIndex">N index.</param>
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
|
||||
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
|
||||
|
||||
/// <summary>
|
||||
/// Sets the window long.
|
||||
/// </summary>
|
||||
/// <returns>The window long.</returns>
|
||||
/// <param name="hWnd">H window.</param>
|
||||
/// <param name="nIndex">N index.</param>
|
||||
/// <param name="dwNewLong">Dw new long.</param>
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
|
||||
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
|
||||
|
||||
/// <summary>
|
||||
/// Sets the window position.
|
||||
/// </summary>
|
||||
/// <returns>The window position.</returns>
|
||||
/// <param name="hWnd">H window.</param>
|
||||
/// <param name="hWndInsertAfter">H window insert after.</param>
|
||||
/// <param name="X">X.</param>
|
||||
/// <param name="Y">Y.</param>
|
||||
/// <param name="cx">Cx.</param>
|
||||
/// <param name="cy">Cy.</param>
|
||||
/// <param name="uFlags">U flags.</param>
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
|
||||
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags);
|
||||
public static void MakeExternalWindowBorderless(IntPtr MainWindowHandle)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue