Skip to content

Commit

Permalink
Infrastructure Preparation 301
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Oct 31, 2024
1 parent 15448aa commit f5c6ad7
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/Skylark.Clipboard/Skylark.Clipboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24522.2</Version>
<Version>9.0.0-beta.24530.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.DNS/Skylark.DNS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24522.2</Version>
<Version>9.0.0-beta.24530.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Standard/Skylark.Standard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24522.2</Version>
<Version>9.0.0-beta.24530.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Uptime/Skylark.Uptime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// Creator: Taiizor
// Website: www.vegalya.com
// Created: 27.Feb.2023
// Changed: 23.Oct.2024
// Changed: 31.Oct.2024
// Version: 3.1.5.4
//
// |---------DO-NOT-REMOVE---------|
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark.Uptime/Skylark.Uptime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24522.2</Version>
<Version>9.0.0-beta.24530.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
14 changes: 8 additions & 6 deletions src/Skylark.Wing/Helper/DesktopCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
using System.Windows;
using System.Windows.Forms;
using SE = Skylark.Exception;
using SEOST = Skylark.Enum.OperatingSystemType;
using SETFT = Skylark.Enum.TimeoutFlagsType;
using SWEOS = Skylark.Wing.Extension.OperatingSystem;
using SWHFI = Skylark.Wing.Helper.FormInterop;
using SWHPI = Skylark.Wing.Helper.ProcessInterop;
using SWHWAPI = Skylark.Wing.Helper.WinAPI;
Expand Down Expand Up @@ -96,15 +98,14 @@ public static bool FixHandle(IntPtr Handle)
// Skip once.
if (Count % 2 == 0)
{
IntPtr Result = IntPtr.Zero;
SWHWAPI.SendMessageTimeout(Progman, 0x052C, new IntPtr(0xD), new IntPtr(0x1), SETFT.SMTO_NORMAL, 10000, out Result);
SWHWAPI.SendMessageTimeout(Progman, 0x052C, new IntPtr(0xD), new IntPtr(0x1), SETFT.SMTO_NORMAL, 10000, out IntPtr Result);
}

SWHWAPI.EnumWindows(new SWHWAPI.EnumWindowsProc((TopHandle, TopParamHandle) =>
{
IntPtr IntPtr = SWHWAPI.FindWindowEx(TopHandle, IntPtr.Zero, "SHELLDLL_DefView", IntPtr.Zero);
IntPtr DefView = SWHWAPI.FindWindowEx(TopHandle, IntPtr.Zero, "SHELLDLL_DefView", IntPtr.Zero);

if (IntPtr != IntPtr.Zero)
if (DefView != IntPtr.Zero)
{
WorkerW = SWHWAPI.FindWindowEx(IntPtr.Zero, TopHandle, "WorkerW", IntPtr.Zero);
}
Expand Down Expand Up @@ -149,11 +150,12 @@ public static bool FixHandle(IntPtr Handle)

private static bool SetParent(IntPtr Handle, IntPtr Progman, IntPtr WorkerW)
{
//Win7
if (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 1)
//To determine if system is running on Windows 7
if (SWEOS.GetOperatingSystem() == SEOST.Windows7)
{
if (!WorkerW.Equals(Progman))
{
// Hide WorkerW to make it act as the wallpaper background
SWNM.ShowWindow(WorkerW, 0);
}

Expand Down
6 changes: 6 additions & 0 deletions src/Skylark.Wing/Native/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ public enum TernaryRasterOperations : uint

#region life cycle

public const int HWND_BOTTOM = 1;

public const int HWND_BROADCAST = 0xffff;

[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
Expand Down Expand Up @@ -573,6 +575,8 @@ public readonly struct RegistryEntry(string fullPathToKey, string valueName, str
[DllImport("user32.dll")]
public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags);

[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
public static extern IntPtr CreateWindowEx(uint dwExStyle, string lpClassName, string lpWindowName, uint dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam);

[DllImport("user32.dll")]
public static extern int GetClassName(int hWnd, StringBuilder lpClassName, int nMaxCount);
Expand Down Expand Up @@ -1864,6 +1868,8 @@ public abstract class WindowStyles
public const uint WS_EX_COMPOSITED = 0x02000000;
public const uint WS_EX_NOACTIVATE = 0x08000000;
//#endif /* _WIN32_WINNT >= 0x0500 */

public const int WS_EX_NOREDIRECTIONBITMAP = 0x00200000;
}


Expand Down
29 changes: 10 additions & 19 deletions src/Skylark.Wing/Native/Win32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,28 @@ public static class Win32
[DllImport("User32.dll")]
public static extern int FindWindowEx(int hwndParent, int hwndChildAfter, string strClassName, string strWindowName);


/// <summary>
/// The SendMessage function sends the specified message to a window or windows.
/// It calls the window procedure for the specified window and does not return
/// until the window procedure has processed the message.
/// </summary>
/// <param name="hWnd"></param>
/// <param name="Msg"></param>
/// <param name="wParam"></param>
/// <param name="lParam"></param>
/// <param name="hWnd">handle to destination window</param>
/// <param name="Msg">message</param>
/// <param name="wParam">first message parameter</param>
/// <param name="lParam">second message parameter</param>
/// <returns></returns>
[DllImport("User32.dll")]
public static extern int SendMessage(
int hWnd, // handle to destination window
int Msg, // message
int wParam, // first message parameter
[MarshalAs(UnmanagedType.LPStr)] string lParam); // second message parameter
public static extern int SendMessage(int hWnd, int Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] string lParam);

/// <summary>
///
/// </summary>
/// <param name="hWnd"></param>
/// <param name="Msg"></param>
/// <param name="wParam"></param>
/// <param name="lParam"></param>
/// <param name="hWnd">handle to destination window</param>
/// <param name="Msg">message</param>
/// <param name="wParam">first message parameter</param>
/// <param name="lParam">second message parameter</param>
/// <returns></returns>
[DllImport("User32.dll")]
public static extern int SendMessage(
int hWnd, // handle to destination window
int Msg, // message
int wParam, // first message parameter
int lParam); // second message parameter
public static extern int SendMessage(int hWnd, int Msg, int wParam, int lParam);
}
}
4 changes: 2 additions & 2 deletions src/Skylark.Wing/Skylark.Wing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// Creator: Taiizor
// Website: www.vegalya.com
// Created: 17.Jun.2023
// Changed: 23.Oct.2024
// Version: 3.1.6.9
// Changed: 31.Oct.2024
// Version: 3.1.7.1
//
// |---------DO-NOT-REMOVE---------|

Expand Down
7 changes: 5 additions & 2 deletions 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.6.9</Version>
<Version>3.1.7.1</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>Skylark.Wing</Title>
Expand Down Expand Up @@ -51,7 +51,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24522.2</Version>
<Version>9.0.0-beta.24530.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand All @@ -74,6 +74,9 @@
<Isolated>false</Isolated>
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
</ItemGroup>

<ItemGroup Condition="!$(TargetFramework.StartsWith('net48'))">
<PackageReference Condition="$(TargetFramework.StartsWith('net6'))" Include="System.Management" Version="6.0.2" />
<PackageReference Condition="$(TargetFramework.StartsWith('net7'))" Include="System.Management" Version="7.0.2" />
<PackageReference Condition="$(TargetFramework.StartsWith('net8'))" Include="System.Management" Version="8.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark/Skylark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// Creator: Taiizor
// Website: www.vegalya.com
// Created: 03.Jan.2023
// Changed: 23.Oct.2024
// Changed: 31.Oct.2024
// Version: 3.1.4.9
//
// |---------DO-NOT-REMOVE---------|
Expand Down
2 changes: 1 addition & 1 deletion src/Skylark/Skylark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub">
<Version>9.0.0-beta.24522.2</Version>
<Version>9.0.0-beta.24530.2</Version>
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down

0 comments on commit f5c6ad7

Please sign in to comment.