Skip to content

Commit

Permalink
Refactor NativeConstants and NativeMethods
Browse files Browse the repository at this point in the history
  • Loading branch information
SadPencil committed Sep 10, 2024
1 parent 2cc85e9 commit 00d20db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 27 deletions.
1 change: 1 addition & 0 deletions Mo3RegUI/Mo3RegUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<Compile Include="MessageLevelToBrushConverter.cs" />
<Compile Include="MessageLevelToFontWeightConverter.cs" />
<Compile Include="MessagesViewModel.cs" />
<Compile Include="NativeConstants.cs" />
<Compile Include="Tasks\DDrawDLLTask.cs" />
<Compile Include="Tasks\DirectXRuntimeTask.cs" />
<Compile Include="Tasks\ForegroundLockTimeoutTask.cs" />
Expand Down
11 changes: 11 additions & 0 deletions Mo3RegUI/NativeConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Mo3RegUI
{
public class NativeConstants
{
/// SM_CXSCREEN -> 0
public const int SM_CXSCREEN = 0;

/// SM_CYSCREEN -> 1
public const int SM_CYSCREEN = 1;
}
}
30 changes: 3 additions & 27 deletions Mo3RegUI/NativeMethods.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,18 @@
namespace Mo3RegUI
{

public partial class NativeMethods
{
/// Return Type: int
///nIndex: int
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "GetSystemMetrics")]
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "GetSystemMetrics")]
public static extern int GetSystemMetrics(int nIndex);
}

public partial class NativeConstants
{
/// SM_CXSCREEN -> 0
public const int SM_CXSCREEN = 0;
}

public partial class NativeConstants
{
/// SM_CYSCREEN -> 1
public const int SM_CYSCREEN = 1;
}

public partial class NativeMethods
{

/// Return Type: UINT->unsigned int
[System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetACP")]
[System.Runtime.InteropServices.DllImport("kernel32.dll", EntryPoint = "GetACP")]
public static extern uint GetACP();

}

public partial class NativeMethods
{

/// Return Type: UINT->unsigned int
[System.Runtime.InteropServices.DllImportAttribute("winmm.dll", EntryPoint = "waveOutGetNumDevs")]
[System.Runtime.InteropServices.DllImport("winmm.dll", EntryPoint = "waveOutGetNumDevs")]
public static extern uint waveOutGetNumDevs();

}

}

0 comments on commit 00d20db

Please sign in to comment.