进程
GetPidByProcessName
窗口
GetWindowThreadProcessId; // 获取窗口的进程ID SetLayeredWindowAttributes: 设置窗口的显示属性 SetParent: 设置窗口的parent ShowWindow:以某个样式显示窗口 SetWindowLong:设置窗口样式 GetWindowLong SetWindowText( hWnd: HWND; {窗口句柄} lpString: PChar {新标题串指针} ): BOOL; SetClassLong: 修改图标、光标、标题等都能改
鼠标相关
GetCursorPos(&point); // 获取鼠标指针位置(屏幕坐标) ScreenToClient(hwnd, &point); // 将鼠标指针位置转换为窗口坐标 GetAsyncKeyState();[GetKeyState] //获取鼠标按键状态可以用,返回值首位bit为1键被按下,为0表示未被按下。(返回值最高位被置1,则这个数表示负数), // The function returns 0 if key is NOT pressed and value < 0 ( less than zero) when key is currently pressed. // VK_XXX 代表所有的键 hCursor SetCursor(hCursor); // 设置鼠标样式,返回原来的
当前应用程序实例句柄
if using MFC AfxGetInstanceHandle(). For console programs, call GetConsoleWindow() to get the HWND then GetWindowLong() to get the HINSTANCE. For the Win32 API, you could also use GetModuleHandle():
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步