Cậu đọc kỹ lại help của chưa.
Trích trong MSDN:
GetWindowThreadProcessId Function
--------------------------------------------------------------------------------
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.
Syntax
DWORD GetWindowThreadProcessId( HWND hWnd,
LPDWORD lpdwProcessId
);
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 Value
The return value is the identifier of the thread that created the window.