Answer in Ruby Re: Using GuiTest, show can I get a Window's Process ID?
- --- In firstname.lastname@example.org, "Mark Andre Hary" <mark_hary@y...>
>In the code below, "IE.new" is equivalent to Win32::Process::Create.
> I start a process using $process = Win32::Process::Create(...).
> I then find a list of Windows via
> That returns a list of window handles whose titles match "blah". How
> can I get the ProcessID of each of those Windows to match against
I think it should be possible to figure out the Perl Win32 stuff from
the following Ruby code. We know the pid is correct because
"Process.kill() works correctly.
require 'watir' # the controller
@ie = IE.new
hWnd = @...
pid=" " * 32
thread= Win32API.new("user32", "GetWindowThreadProcessId", 'IP',
fixnum_pid = pid.unpack("L")
Process.kill( 9 , fixnum_pid)