Skip to content

Commit add569b

Browse files
committed
Added Ignore List, some cosmetic changes
1 parent 1a102d6 commit add569b

17 files changed

Lines changed: 4599 additions & 67 deletions

CountyChecker/CC.png

64.3 KB
Loading

CountyChecker/CenterWinDialog.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ You should have received a copy of the GNU Affero General Public License along w
1919
using System.Windows.Forms;
2020
using System.Runtime.InteropServices;
2121

22-
class CenterWinDialog : IDisposable {
22+
partial class CenterWinDialog : IDisposable {
2323
private int mTries = 0;
24-
private Form mOwner;
24+
private readonly Form mOwner;
2525

2626
public CenterWinDialog(Form owner) {
2727
mOwner = owner;
@@ -32,20 +32,19 @@ public CenterWinDialog(Form owner) {
3232
private void findDialog() {
3333
// Enumerate windows to find the message box
3434
if (mTries < 0) return;
35-
EnumThreadWndProc callback = new EnumThreadWndProc(checkWindow);
35+
EnumThreadWndProc callback = new(checkWindow);
3636
if (EnumThreadWindows(GetCurrentThreadId(), callback, IntPtr.Zero)) {
3737
if (++mTries < 10) mOwner.BeginInvoke(new MethodInvoker(findDialog));
3838
}
3939
}
4040
private bool checkWindow(IntPtr hWnd, IntPtr lp) {
4141
// Checks if <hWnd> is a dialog
42-
StringBuilder sb = new StringBuilder(260);
43-
GetClassName(hWnd, sb, sb.Capacity);
44-
if (sb.ToString() != "#32770") return true;
42+
StringBuilder sb = new(260);
43+
int classNameResult = GetClassName(hWnd, sb, sb.Capacity);
44+
if (classNameResult == 0 || sb.ToString() != "#32770") return true;
4545
// Got it
46-
Rectangle frmRect = new Rectangle(mOwner.Location, mOwner.Size);
47-
RECT dlgRect;
48-
GetWindowRect(hWnd, out dlgRect);
46+
Rectangle frmRect = new(mOwner.Location, mOwner.Size);
47+
GetWindowRect(hWnd, out RECT dlgRect);
4948
MoveWindow(hWnd,
5049
frmRect.Left + (frmRect.Width - dlgRect.Right + dlgRect.Left) / 2,
5150
frmRect.Top + (frmRect.Height - dlgRect.Bottom + dlgRect.Top) / 2,
@@ -63,8 +62,12 @@ public void Dispose() {
6362
private static extern bool EnumThreadWindows(int tid, EnumThreadWndProc callback, IntPtr lp);
6463
[DllImport("kernel32.dll")]
6564
private static extern int GetCurrentThreadId();
66-
[DllImport("user32.dll")]
67-
private static extern int GetClassName(IntPtr hWnd, StringBuilder buffer, int buflen);
65+
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
66+
private static extern int GetClassName(
67+
IntPtr hWnd,
68+
[MarshalAs(UnmanagedType.LPWStr, SizeParamIndex = 2)] StringBuilder buffer,
69+
int buflen
70+
);
6871
[DllImport("user32.dll")]
6972
private static extern bool GetWindowRect(IntPtr hWnd, out RECT rc);
7073
[DllImport("user32.dll")]

CountyChecker/CountyChecker.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
<ApplicationIcon>CC.ico</ApplicationIcon>
1010
<PackageLicenseFile>LICENSE</PackageLicenseFile>
1111
<PackageReadmeFile>README.md</PackageReadmeFile>
12+
<Description>CountyChecker Report Generator</Description>
13+
<PackageProjectUrl>https://github.com/Stumpy842/CountyChecker</PackageProjectUrl>
14+
<PackageIcon>CC.png</PackageIcon>
15+
<RepositoryUrl>https://github.com/Stumpy842/CountyChecker</RepositoryUrl>
16+
<PackageTags>CountyCheck</PackageTags>
17+
<PackageReleaseNotes>Added Ignore List</PackageReleaseNotes>
18+
<AssemblyVersion>1.0.1.0</AssemblyVersion>
19+
<FileVersion>1.0.1.0</FileVersion>
1220
</PropertyGroup>
1321

1422
<ItemGroup>
@@ -53,4 +61,11 @@
5361
</EmbeddedResource>
5462
</ItemGroup>
5563

64+
<ItemGroup>
65+
<None Update="CC.png">
66+
<Pack>True</Pack>
67+
<PackagePath>\</PackagePath>
68+
</None>
69+
</ItemGroup>
70+
5671
</Project>

CountyChecker/Form1.Designer.cs

Lines changed: 77 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)