#include <stdio.h> #include <Windows.h> DWORD 窗口句柄_取进程id(HWND hwnd){ DWORD dword = 0;; GetWindowThreadProcessId(hwnd, &dword); return dword; } int main(){ DWORD 进程id = 窗口句柄_取进程id((HWND)3215688); printf("%d", (int)进程id); getchar(); return 0; }