RustyHearts-Launcher/RHLauncher.Helper/FormUtils.cs
2024-01-04 22:59:30 -03:00

20 lines
No EOL
596 B
C#

using System.Runtime.InteropServices;
namespace RHLauncher.RHLauncher.Helper
{
public class FormUtils
{
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HTCAPTION = 0x2;
[DllImport("User32.dll")]
private static extern bool ReleaseCapture();
[DllImport("User32.dll")]
private static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
public static void MoveForm(IntPtr handle)
{
ReleaseCapture();
SendMessage(handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
}
}