首页 > 系统相关 >MFC-GetWindowThreadProcessId获取指定窗口线程ID和进程ID

MFC-GetWindowThreadProcessId获取指定窗口线程ID和进程ID

时间:2023-03-10 09:24:46浏览次数:32  
标签:GetWindowThreadProcessId MFC 窗口 线程 str ID dwPID

 

    HWND hWnd = ::FindWindow(NULL, _T("sss.txt - 记事本"));
    DWORD dwTID=0;
    DWORD dwPID = NULL;
    dwTID = ::GetWindowThreadProcessId(hWnd, &dwPID);//获取指定窗口线程ID和进程ID
    //参数1:窗口句柄HWND
    //参数2:LPDWORD  保存进程ID
    //返回值:线程ID

    CString str;
    str.Format(_T("%d"), dwPID);
    AfxMessageBox(str);

 

 

 

 

标签:GetWindowThreadProcessId,MFC,窗口,线程,str,ID,dwPID
From: https://www.cnblogs.com/liming19680104/p/17202227.html

相关文章