making unwanted functions internal

master
Zaafar 5 years ago
parent 584ea2513e
commit c84bda8a62
  1. 2
      ClickableTransparentOverlay/ImGuiController.cs
  2. 20
      ClickableTransparentOverlay/NativeMethods.cs
  3. 4
      DriverProgram/Program.cs

@ -13,7 +13,7 @@ namespace ClickableTransparentOverlay
/// A modified version of Veldrid.ImGui's ImGuiRenderer. /// A modified version of Veldrid.ImGui's ImGuiRenderer.
/// Manages input for ImGui and handles rendering ImGui's DrawLists with Veldrid. /// Manages input for ImGui and handles rendering ImGui's DrawLists with Veldrid.
/// </summary> /// </summary>
public class ImGuiController : IDisposable internal class ImGuiController : IDisposable
{ {
private GraphicsDevice _gd; private GraphicsDevice _gd;
private bool _frameBegun; private bool _frameBegun;

@ -29,7 +29,7 @@ namespace ClickableTransparentOverlay
/// <param name="handle"> /// <param name="handle">
/// Veldrid window handle in IntPtr format. /// Veldrid window handle in IntPtr format.
/// </param> /// </param>
public static void InitTransparency(IntPtr handle) internal static void InitTransparency(IntPtr handle)
{ {
GWL_EXSTYLE_CLICKABLE = GetWindowLongPtr(handle, GWL_EXSTYLE); GWL_EXSTYLE_CLICKABLE = GetWindowLongPtr(handle, GWL_EXSTYLE);
GWL_EXSTYLE_NOT_CLICKABLE = new IntPtr( GWL_EXSTYLE_NOT_CLICKABLE = new IntPtr(
@ -45,7 +45,7 @@ namespace ClickableTransparentOverlay
/// </summary> /// </summary>
/// <param name="handle">Veldrid window handle in IntPtr format.</param> /// <param name="handle">Veldrid window handle in IntPtr format.</param>
/// <param name="WantClickable">Set to true if you want to make the window clickable otherwise false.</param> /// <param name="WantClickable">Set to true if you want to make the window clickable otherwise false.</param>
public static void SetOverlayClickable(IntPtr handle, bool WantClickable) internal static void SetOverlayClickable(IntPtr handle, bool WantClickable)
{ {
if (!IsClickable && WantClickable) if (!IsClickable && WantClickable)
{ {
@ -63,7 +63,7 @@ namespace ClickableTransparentOverlay
/// <summary> /// <summary>
/// Allows showing/hiding the console window. /// Allows showing/hiding the console window.
/// </summary> /// </summary>
public static void SetConsoleWindow(bool visiable) internal static void SetConsoleWindow(bool visiable)
{ {
if (visiable) if (visiable)
{ {
@ -83,7 +83,7 @@ namespace ClickableTransparentOverlay
/// </summary> /// </summary>
/// <param name="hWnd"></param> /// <param name="hWnd"></param>
/// <returns></returns> /// <returns></returns>
public static Vector2 GetCursorPosition(IntPtr hWnd) internal static Vector2 GetCursorPosition(IntPtr hWnd)
{ {
if (GetCursorPos(out var lpPoint)) if (GetCursorPos(out var lpPoint))
{ {
@ -100,23 +100,23 @@ namespace ClickableTransparentOverlay
/// </summary> /// </summary>
/// <param name="nVirtKey">key to look for.</param> /// <param name="nVirtKey">key to look for.</param>
/// <returns>weather the key is pressed or not.</returns> /// <returns>weather the key is pressed or not.</returns>
public static bool isKeyPressed(int nVirtKey) public static bool IsKeyPressed(int nVirtKey)
{ {
return Convert.ToBoolean(GetKeyState(nVirtKey) & KEY_PRESSED); return Convert.ToBoolean(GetKeyState(nVirtKey) & KEY_PRESSED);
} }
[DllImport("USER32.dll")] [DllImport("USER32.dll")]
static extern short GetKeyState(int nVirtKey); private static extern short GetKeyState(int nVirtKey);
[DllImport("user32.dll", SetLastError = true)] [DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetCursorPos(out POINT lpPoint); private static extern bool GetCursorPos(out POINT lpPoint);
[DllImport("user32.dll")] [DllImport("user32.dll")]
static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint); private static extern bool ScreenToClient(IntPtr hWnd, ref POINT lpPoint);
[DllImport("user32.dll", SetLastError = true)] [DllImport("user32.dll", SetLastError = true)]
static extern IntPtr SetFocus(IntPtr hWnd); private static extern IntPtr SetFocus(IntPtr hWnd);
[DllImport("dwmapi.dll")] [DllImport("dwmapi.dll")]
private static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset); private static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset);
@ -155,7 +155,7 @@ namespace ClickableTransparentOverlay
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct POINT internal struct POINT
{ {
public int X; public int X;
public int Y; public int Y;

@ -35,7 +35,7 @@ namespace DriverProgram
{ {
yield return new WaitEvent(Overlay.OnRender); yield return new WaitEvent(Overlay.OnRender);
if (NativeMethods.isKeyPressed(0x7B)) //F12. if (NativeMethods.IsKeyPressed(0x7B)) //F12.
{ {
showClickableMenu = !showClickableMenu; showClickableMenu = !showClickableMenu;
} }
@ -148,6 +148,8 @@ namespace DriverProgram
ImGui.End(); ImGui.End();
} }
ImGui.End();
} }
} }

Loading…
Cancel
Save