- Aug
- 2,294
- 111
Hi Charles,
I have a program that I put together,
which provides me with the ProcessID of a hWnd,
using the GetWindowThreadProcessId API to obtain such.
Would you please add a function to your WindowInfo plugin that would provide the ProcessID of a hWnd?
Joe
I have a program that I put together,
which provides me with the ProcessID of a hWnd,
using the GetWindowThreadProcessId API to obtain such.
Would you please add a function to your WindowInfo plugin that would provide the ProcessID of a hWnd?
Code:
$COMPILE EXE
$REGISTER NONE
$INCLUDE "WIN32API.INC"
FUNCTION PBMAIN AS LONG
DIM gsTitle AS GLOBAL STRING
EnumWindows CODEPTR(EnumWindowsProc), 0
END FUNCTION
FUNCTION EnumWindowsProc(BYVAL lHandle AS LONG, BYVAL lNotUsed AS LONG) PRIVATE AS LONG
DIM gsTitle AS GLOBAL STRING
DIM dwProcessId AS GLOBAL DWORD
gsTitle = STRING$(256,0)
GetWindowText lHandle, BYVAL STRPTR(gsTitle), 256
gsTitle = EXTRACT$(gsTitle,CHR$(0))
ucTitle$ = UCASE$(gsTitle)
Arg1$ = UCASE$(COMMAND$(1))
IF LEN(gsTitle) THEN
IF TALLY(ucTitle$, Arg1$) > 0 THEN
STDOUT USING$("##########",lHandle);
STDOUT " ";
CALL GetWindowThreadProcessId(lHandle, dwProcessId)
STDOUT USING$("##########",dwProcessID);
STDOUT " ";
STDOUT gsTitle
END IF
IF TRIM$(COMMAND$) = "" THEN
STDOUT USING$("##########",lHandle);
STDOUT " ";
CALL GetWindowThreadProcessId(lHandle, dwProcessId)
STDOUT USING$("##########",dwProcessID);
STDOUT " ";
STDOUT gsTitle
END IF
END IF
FUNCTION = 1
END FUNCTION
Joe