每次用到API或宏定義時都得找半天,現記下,以後方便
[DllImport("user32.dll")]
public static extern void PostMessageA(int hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern int FindWindowExA(int hWnd1, int hWnd2, string lpsz1, string lpsz2);
[DllImport("kernel32.dll")]
public static extern int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId);
[DllImport("kernel32.dll")]
public static extern int ReadProcessMemory(int hProcess, int lpBaseAddress,out int lpBuffer, int nSize, int lpNumberOfBytesWritten);
[DllImport("kernel32.dll")]
public static extern int ReadProcessMemory(int hProcess, int lpBaseAddress, out char lpBuffer, int nSize, int lpNumberOfBytesWritten);
[DllImport("User32.dll")]
public static extern int GetWindowThreadProcessId(int hwnd,out int lpdwProcessId);
[DllImport("user32.dll")]
public static extern int FindWindowA(string lpClassName, string lpWindowName);