Skip to content

Commit

Permalink
Fixed a few possible bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
AraHaan committed Feb 19, 2024
1 parent 7ef4097 commit 4c7b833
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@main

- name: Install latest .NET 7 SDK
- name: Install latest .NET 8 SDK
uses: Elskom/setup-latest-dotnet@main
with:
SDK_VERSION: '8.0.100'
SDK_VERSION: '8.0.200'
RUNTIME_VERSIONS: ''

- name: Install Elskom workload
Expand Down
2 changes: 1 addition & 1 deletion Els_kom/Controls/ThemedForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private unsafe List<MENUITEMINFO> GetMenuInfo(HMENU hWnd)
mif.Text = new string(' ', (int)mif.MenuItemInfo.cch);
fixed (char* pTypeDataStr = mif.Text)
{
mif.MenuItemInfo.dwTypeData = (ushort*)pTypeDataStr;
mif.MenuItemInfo.dwTypeData = pTypeDataStr;
_ = Windows.GetMenuItemInfo(hWnd, (uint)i, true, &mif.MenuItemInfo);
}

Expand Down
4 changes: 3 additions & 1 deletion Els_kom/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- suppress message when using the .NET Preview SDKs. -->
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<OutputType>WinExe</OutputType>
<Prefer32Bit>true</Prefer32Bit>
<!-- <Prefer32Bit>true</Prefer32Bit> -->
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Els_kom</RootNamespace>
<AssemblyName>Els_kom</AssemblyName>
Expand Down Expand Up @@ -43,6 +43,8 @@
<CodeAnalysisRuleSet>..\Els_kom.ruleset</CodeAnalysisRuleSet>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GitBuildInfoAssemblyType>FormsApplication</GitBuildInfoAssemblyType>
<!-- This is annoying as fuck as well. -->
<GenerateResourceWarnOnBinaryFormatterUse>false</GenerateResourceWarnOnBinaryFormatterUse>
</PropertyGroup>

</Project>
4 changes: 2 additions & 2 deletions Els_kom/FormsApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ private static void MiniDump_Dump(object? sender, MiniDumpEventArgs e)
private static void MiniDump_DumpMessage(object? sender, MessageEventArgs e)
{
_ = MessageManager.ShowError(e.Text, e.Caption, false);
if (!e.Text.StartsWith("Mini-dumping failed with Code: "))
if (!e.Text.StartsWith("Mini-dumping failed with Code: ", StringComparison.Ordinal))
{
// save screenshot of crash.
using (var screenshot = ScreenShots.MakeScreenShot())
{
screenshot.Save(SettingsFile.MiniDumpPath.Replace(".mdmp", ".png"), ImageFormat.Png);
screenshot.Save(SettingsFile.MiniDumpPath.Replace(".mdmp", ".png", StringComparison.OrdinalIgnoreCase), ImageFormat.Png);
}

Environment.Exit(1);
Expand Down
8 changes: 4 additions & 4 deletions Els_kom/Icons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ public static bool IconEquals(Icon icon1, Icon icon2)
}
else if (bitmap1.Size == bitmap2.Size)
{
for (var y = 0; y < bitmap1?.Height; y++)
for (var y = 0; y < bitmap1.Height; y++)
{
for (var x = 0; x < bitmap1?.Width; x++)
for (var x = 0; x < bitmap1.Width; x++)
{
var col1 = bitmap1?.GetPixel(x, y);
var col2 = bitmap2?.GetPixel(x, y);
var col1 = bitmap1.GetPixel(x, y);
var col2 = bitmap2.GetPixel(x, y);
if (!col1.Equals(col2))
{
result = false;
Expand Down
2 changes: 1 addition & 1 deletion Els_kom/Themes/ApplicationResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ private static unsafe void EnableUxThemeDarkMode(nint hwnd, bool enable)
const string themeName = "DarkMode_Explorer";
fixed (char* szExplorer = themeName)
{
_ = Windows.SetWindowTheme((HWND)hwnd, (ushort*)szExplorer, null);
_ = Windows.SetWindowTheme((HWND)hwnd, szExplorer, null);
}
}
else
Expand Down

0 comments on commit 4c7b833

Please sign in to comment.