No real changes

This commit is contained in:
CreepyCrafter24 2020-01-10 16:52:06 +01:00
parent 1b59434855
commit 5a4f4c083f
7 changed files with 15 additions and 20 deletions

View File

@ -13,6 +13,8 @@
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -22,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\Misc.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -30,6 +33,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Misc.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -13,6 +13,8 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -23,6 +25,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\W32.Test.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@ -32,6 +35,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\W32.Test.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -31,7 +31,7 @@ namespace CC_Functions.W32.Hooks
UnhookWindowsHookEx(_hookID);
}
public event KeyPress OnKeyPress;
public event KeyPress? OnKeyPress;
private IntPtr SetHook(LowLevelKeyboardProc proc)
{

View File

@ -40,7 +40,7 @@ namespace CC_Functions.W32.Hooks
UnhookWindowsHookEx(_hookID);
}
public event MouseEvent OnMouse;
public event MouseEvent? OnMouse;
private static IntPtr SetHook(LowLevelMouseProc proc)
{

View File

@ -158,26 +158,9 @@ namespace CC_Functions.W32
internal static class NativeMethods
{
internal const int SE_PRIVILEGE_ENABLED = 0x00000002;
internal const int ERROR_NOT_ALL_ASSIGNED = 1300;
internal const uint STANDARD_RIGHTS_REQUIRED = 0x000F0000;
internal const uint STANDARD_RIGHTS_READ = 0x00020000;
internal const uint TOKEN_ASSIGN_PRIMARY = 0x0001;
internal const uint TOKEN_DUPLICATE = 0x0002;
internal const uint TOKEN_IMPERSONATE = 0x0004;
internal const uint TOKEN_QUERY = 0x0008;
internal const uint TOKEN_QUERY_SOURCE = 0x0010;
internal const uint TOKEN_ADJUST_PRIVILEGES = 0x0020;
internal const uint TOKEN_ADJUST_GROUPS = 0x0040;
internal const uint TOKEN_ADJUST_DEFAULT = 0x0080;
internal const uint TOKEN_ADJUST_SESSIONID = 0x0100;
internal const uint TOKEN_READ = STANDARD_RIGHTS_READ | TOKEN_QUERY;
internal const uint TOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE |
TOKEN_IMPERSONATE | TOKEN_QUERY
| TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES |
TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | TOKEN_ADJUST_SESSIONID;
[DllImport("advapi32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]

View File

@ -13,6 +13,8 @@
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -23,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\Debug\W32.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -32,6 +35,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\Release\W32.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

View File

@ -22,7 +22,7 @@ namespace CC_Functions.W32
public static Wnd32 getProcessMain(Process process) => fromHandle(process.MainWindowHandle);
public static Wnd32 fromMetadata(string lpClassName = null, string lpWindowName = null) =>
public static Wnd32 fromMetadata(string? lpClassName = null, string? lpWindowName = null) =>
fromHandle(FindWindow(lpClassName, lpWindowName));
public static Wnd32 fromPoint(Point point) => fromHandle(WindowFromPoint(point.X, point.Y));