GetWindowThreadProcessId(handle,PDWORD=n)
does not give a value back for second parameter.
TCC v28 Code:
set hprogman=%@winapi[user32.dll,FindWindow,Progman,"Program Manager"]
set hshell=%@winapi[user32.dll,FindWindowEx,%hprogman,NULL,"shelldll_defview",NULL]
set hListView=%@winapi[user32.dll,FindWindowEx,%hshell,NULL,"syslistview32",NULL]
echo hlistView = %hlistView
hlistView = 65874
set PID=-1
set thread=%@winapi[user32.dll,GetWindowThreadProcessId,%hListView,PDWORD=PID]
echo thread=%thread PID=%PID
thread=5468 PID=-1
The PID variable value is not changed.
From the help:
"PDWORD - a pointer to the DWORD n"
Its not clear what n is,
Is n an environment variable? , must it exist before the call?
In python we get a PID for the handle:
python -c "from win32process import GetWindowThreadProcessId;print(GetWindowThreadProcessId(%hlistView))"
[5468, 5472]
How do get @winapi working for GetWindowThreadProcessId?