Update Types.cs, User32.cs, and WinDef.cs
This commit is contained in:
parent
6a706fbdb8
commit
4c82885209
5
NibblePoker.Win32Bindings/Types.cs
Normal file
5
NibblePoker.Win32Bindings/Types.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace NibblePoker.Win32Bindings;
|
||||
|
||||
public static class Types {
|
||||
public const Type LONG = UInt32;
|
||||
}
|
@ -1,10 +1,26 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using static NibblePoker.Win32Bindings.WinDef;
|
||||
|
||||
namespace NibblePoker.Win32Bindings;
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable UnusedMember.Global
|
||||
public class User32 {
|
||||
// https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types
|
||||
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-paintstruct
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct PAINTSTRUCT {
|
||||
public IntPtr hdc; // HDC
|
||||
public bool fErase; // BOOL
|
||||
public RECT rcPaint;
|
||||
public bool fRestore; // BOOL
|
||||
public bool fIncUpdate; // BOOL
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
|
||||
public byte[] dwExtraInfo; // BYTE[32]
|
||||
}
|
||||
|
||||
#region MB_* flags
|
||||
|
||||
@ -64,6 +80,31 @@ public class User32 {
|
||||
|
||||
#endregion
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-beginpaint
|
||||
[DllImport("user32.dll", CharSet = CharSet.None, SetLastError = false)]
|
||||
[return: MarshalAs(UnmanagedType.SysInt)]
|
||||
public static extern IntPtr BeginPaint([In] IntPtr hWnd, [Out] out PAINTSTRUCT lpPaint);
|
||||
|
||||
// ChangeDisplaySettingsA
|
||||
// ChangeDisplaySettingsExA
|
||||
// ChangeDisplaySettingsExW
|
||||
// ChangeDisplaySettingsW
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-clienttoscreen
|
||||
[DllImport("user32.dll", CharSet = CharSet.None, SetLastError = false)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool ClientToScreen(IntPtr hWnd, [In, Out] ref POINT lpPoint);
|
||||
|
||||
// CopyRect
|
||||
// DrawAnimatedRects
|
||||
|
||||
/// ...
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-endpaint
|
||||
[DllImport("user32.dll", CharSet = CharSet.None, SetLastError = false)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool EndPaint([In] IntPtr hWnd, [In] ref PAINTSTRUCT lpPaint);
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebeep
|
||||
[DllImport("user32.dll", CharSet = CharSet.None, SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
@ -82,5 +123,4 @@ public class User32 {
|
||||
|
||||
//[DllImport("user32")]
|
||||
//public static extern int GetWindowText(int hwnd, StringBuilder lptrString, int nMaxCount);
|
||||
|
||||
}
|
||||
|
23
NibblePoker.Win32Bindings/WinDef.cs
Normal file
23
NibblePoker.Win32Bindings/WinDef.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace NibblePoker.Win32Bindings;
|
||||
|
||||
public class WinDef {
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-point
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct POINT {
|
||||
public UInt32 x; // LONG
|
||||
public UInt32 y; // LONG
|
||||
}
|
||||
|
||||
/// https://learn.microsoft.com/en-us/windows/win32/api/windef/ns-windef-rect
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct RECT {
|
||||
public UInt32 left; // LONG
|
||||
public UInt32 top; // LONG
|
||||
public UInt32 right; // LONG
|
||||
public UInt32 bottom; // LONG
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user