Skip to content

Commit

Permalink
Infrastructure Preparation 278
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Jun 6, 2024
1 parent 413dc28 commit 7677af2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Skylark" Version="3.1.4.2" />
<PackageReference Include="Skylark.Wing" Version="3.1.5.2" />
<PackageReference Include="Skylark.Wing" Version="3.1.5.3" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Skylark.Wing/Helper/SystemInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public static long GetTotalInstalledMemory()
{
SWNM.GetPhysicallyInstalledSystemMemory(out long memKb);

return memKb / 1024;
return memKb;
}

/// <summary>
Expand Down
31 changes: 31 additions & 0 deletions src/Skylark.Wing/Native/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ public struct OSVERSIONINFOEX
public byte Reserved;
}

/// <summary>
///
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct SYSTEM_INFO
{
Expand All @@ -476,6 +479,9 @@ public struct SYSTEM_INFO
public ushort processorRevision;
}

/// <summary>
///
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct LASTINPUTINFO
{
Expand All @@ -487,6 +493,25 @@ public struct LASTINPUTINFO
public uint dwTime;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public class MEMORYSTATUSEX
{
public uint dwLength;
public uint dwMemoryLoad;
public ulong ullTotalPhys;
public ulong ullAvailPhys;
public ulong ullTotalPageFile;
public ulong ullAvailPageFile;
public ulong ullTotalVirtual;
public ulong ullAvailVirtual;
public ulong ullAvailExtendedVirtual;

public MEMORYSTATUSEX()
{
dwLength = (uint)Marshal.SizeOf<MEMORYSTATUSEX>();
}
}

/// <remarks>
///
/// </remarks>
Expand Down Expand Up @@ -1550,6 +1575,10 @@ public enum WM : uint
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern int GetWindowTextLength(IntPtr hWnd);

[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern bool GlobalMemoryStatusEx([In, Out] MEMORYSTATUSEX lpBuffer);

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);

Expand All @@ -1561,6 +1590,7 @@ public enum WM : uint
public static extern bool GetPhysicallyInstalledSystemMemory(out long TotalMemoryInKilobytes);

#region Window_Style

[DllImport("user32.dll")]
public static extern IntPtr GetMenu(IntPtr hWnd);

Expand Down Expand Up @@ -1617,6 +1647,7 @@ public enum SendMessageTimeoutFlags : uint
SMTO_NOTIMEOUTIFNOTHUNG = 0x8,
SMTO_ERRORONEXIT = 0x20
}

public enum AnimateWindowFlags : uint
{
AW_HOR_POSITIVE = 0x00000001,
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Wing/Skylark.Wing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// Website: www.Vegalya.com
// Created: 17.Jun.2023
// Changed: 06.Jun.2024
// Version: 3.1.5.3
// Version: 3.1.5.4
//
// |---------DO-NOT-REMOVE---------|

Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Wing/Skylark.Wing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<PropertyGroup>
<ApplicationIcon>Resources\Skylark.Wing.ico</ApplicationIcon>
<Version>3.1.5.3</Version>
<Version>3.1.5.4</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>Skylark.Wing</Title>
Expand Down

0 comments on commit 7677af2

Please sign in to comment.