HWND hWnd = ::FindWindow(_T("Windows.UI.Core.CoreWindow"), NULL);//获取与指定窗口类名和窗口名的最顶层窗口的窗口句柄 //寻找系统计算器句柄(win10) if (!hWnd) { AfxMessageBox(_T("系统计算器句柄没找到")); } DWORD pid = NULL; ::GetWindowThreadProcessId(hWnd, &pid);//获取指定窗口进程ID HANDLE process = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_QUERY_INFORMATION, FALSE, pid);
标签:MFC,HANDLE,PROCESS,HWND,pid,VM,hWnd,句柄,窗口 From: https://www.cnblogs.com/liming19680104/p/17433535.html