mirror of
https://github.com/quasar/Quasar.git
synced 2026-10-29 12:12:31 +08:00
45 lines
2.0 KiB
C#
45 lines
2.0 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace xServer.Core.Utilities
|
|
{
|
|
/// <summary>
|
|
/// Provides some methods from the "user32.dll" and uxtheme libraries.
|
|
/// </summary>
|
|
public static class NativeMethods
|
|
{
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern IntPtr SendMessage(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
|
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, string lParam);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern IntPtr LoadCursor(IntPtr hInstance, int lpCursorName);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern IntPtr SetCursor(IntPtr hCursor);
|
|
|
|
[DllImport("user32.dll", SetLastError = true)]
|
|
public static extern IntPtr LoadImage(IntPtr hinst, string lpszName, uint uType, int cxDesired, int cyDesired, uint fuLoad);
|
|
|
|
[DllImport("uxtheme.dll", CharSet = CharSet.Unicode, SetLastError = true)]
|
|
public extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName, string pszSubIdList);
|
|
|
|
[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);
|
|
}
|
|
}
|