2010-03-01 16:47:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Security;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2010-12-22 09:19:58 +00:00
|
|
|
|
using System.Drawing;
|
2010-03-01 16:47:58 +00:00
|
|
|
|
|
|
|
|
|
namespace GSDumpGUI
|
|
|
|
|
{
|
|
|
|
|
static public class NativeMethods
|
|
|
|
|
{
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("kernel32")]
|
|
|
|
|
public extern static IntPtr LoadLibrary(string lpLibFileName);
|
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("kernel32")]
|
|
|
|
|
public extern static bool FreeLibrary(IntPtr hLibModule);
|
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("kernel32", CharSet = CharSet.Ansi)]
|
|
|
|
|
public extern static IntPtr GetProcAddress(IntPtr hModule, string lpProcName);
|
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("kernel32", CharSet = CharSet.Ansi)]
|
|
|
|
|
public extern static int SetErrorMode(int Value);
|
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("kernel32", CharSet = CharSet.Ansi)]
|
|
|
|
|
public extern static int GetLastError();
|
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("user32", CharSet = CharSet.Ansi)]
|
|
|
|
|
public extern static short GetAsyncKeyState(int key);
|
2010-03-04 14:54:20 +00:00
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("user32", CharSet = CharSet.Ansi)]
|
|
|
|
|
public extern static int SetClassLong(IntPtr HWND, int index, long newlong);
|
2010-12-19 14:41:11 +00:00
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("user32", CharSet = CharSet.Ansi)]
|
|
|
|
|
public extern static bool IsWindowVisible(IntPtr HWND);
|
2010-12-22 09:19:58 +00:00
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
|
|
|
public static extern bool PeekMessage(out NativeMessage message, IntPtr hwnd, uint messageFilterMin, uint messageFilterMax, uint flags);
|
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
|
|
|
public static extern bool TranslateMessage(ref NativeMessage message);
|
|
|
|
|
|
|
|
|
|
[SuppressUnmanagedCodeSecurityAttribute]
|
|
|
|
|
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)]
|
|
|
|
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|
|
|
|
public static extern bool DispatchMessage(ref NativeMessage message);
|
2010-03-01 16:47:58 +00:00
|
|
|
|
}
|
2010-12-22 09:19:58 +00:00
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
|
|
|
public struct NativeMessage
|
|
|
|
|
{
|
|
|
|
|
public IntPtr hWnd;
|
|
|
|
|
public uint msg;
|
|
|
|
|
public IntPtr wParam;
|
|
|
|
|
public IntPtr lParam;
|
|
|
|
|
public uint time;
|
|
|
|
|
public Point p;
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-01 16:47:58 +00:00
|
|
|
|
}
|