mirror of
https://github.com/quasar/Quasar.git
synced 2026-10-26 10:35:48 +08:00
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace xClient.Core.Utilities
|
|
{
|
|
/// <summary>
|
|
/// Provides some methods from the "user32.dll" and uxtheme libraries.
|
|
/// </summary>
|
|
public static class NativeMethods
|
|
{
|
|
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
public static extern bool DeleteFile(string name);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern bool SetCursorPos(int x, int y);
|
|
|
|
[DllImport("user32.dll")]
|
|
public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern unsafe int memcmp(byte* ptr1, byte* ptr2, uint count);
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern int memcmp(IntPtr ptr1, IntPtr ptr2, uint count);
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern int memcpy(IntPtr dst, IntPtr src, uint count);
|
|
|
|
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
public static extern unsafe int memcpy(void* dst, void* src, uint count);
|
|
}
|
|
}
|