GetWindowThreadProcessId The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window. DWORD GetWindowThreadProcessId( HWND hWnd, // handle to window LPDWORD lpdwProcessId // process identifier ); Parameters hWnd [in] Handle to the window. lpdwProcessId [out] Pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not. Return Values The return value is the identifier of the thread that created the window.
你只要 DWORD PID, TID; TID = ::GetWindowThreadProcessId (pWnd->m_hwnd, &PID); 就行了
The GetWindowThreadProcessId function retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window. DWORD GetWindowThreadProcessId(
HWND hWnd, // handle to window
LPDWORD lpdwProcessId // process identifier
);
Parameters
hWnd
[in] Handle to the window.
lpdwProcessId
[out] Pointer to a variable that receives the process identifier. If this parameter is not NULL, GetWindowThreadProcessId copies the identifier of the process to the variable; otherwise, it does not.
Return Values
The return value is the identifier of the thread that created the window.
DWORD PID, TID;
TID = ::GetWindowThreadProcessId (pWnd->m_hwnd, &PID);
就行了
GetWindowThreadProcessId 这个函数不可以吧,
zhouyong0371你的语句不能通过编译 阿???
TID = ::GetWindowThreadProcessId (pWnd->m_hwnd, &PID);绝对可行的,你把pWnd改为this、把m_hwnd 改为m_hWnd 试一下。