获取窗口句柄:
HWND FindWindow(
LPCTSTR lpClassName, // pointer to class name
LPCTSTR lpWindowName // pointer to window name
);
获取窗口信息:
BOOL GetWindowRect(
HWND hWnd, // handle to window
LPRECT lpRect // address of structure for window coordinates
);
设置鼠标位置:
BOOL SetCursorPos(
int X, // horizontal position
int Y // vertical position
);
获取鼠标位置:
BOOL GetCursorPos(
LPPOINT lpPoint // address of structure for cursor position
);
鼠标事件:
VOID mouse_event(
DWORD dwFlags, // flags specifying various motion/click variants
DWORD dx, // horizontal mouse position or position change
DWORD dy, // vertical mouse position or position change
DWORD dwData, // amount of wheel movement
DWORD dwExtraInfo
// 32 bits of application-defined information
);
根据窗口句柄获取进程ID:
DWORD GetWindowThreadProcessId(
HWND hWnd, // handle to window
LPDWORD lpdwProcessId // address of variable for process identifier
);
打开一个进程:
HANDLE OpenProcess(
DWORD dwDesiredAccess, // access flag
BOOL bInheritHandle, // handle inheritance flag
DWORD dwProcessId // process identifier
);
读取进程指定地址内存:
BOOL ReadProcessMemory(
HANDLE hProcess, // handle to the process whose memory is read
LPCVOID lpBaseAddress,
// address to start reading
LPVOID lpBuffer, // address of buffer to place read data
DWORD nSize, // number of bytes to read
LPDWORD lpNumberOfBytesRead
// address of number of bytes read
);
话说ReadProcessMemory对于现在连变量类型都搞不清楚的我实在是太难了。