in reply to Win32::GuiTest process id

http://search.cpan.org/grep?cpanid=KARASIK&release=Win32-GuiTest-1.56&string=pid&i=1&n=1&C=0 http://search.cpan.org/grep?cpanid=KARASIK&release=Win32-GuiTest-1.56&string=process&i=1&n=1&C=0

Either hack Win32::GuiTest to expose GetWindowThreadProcessId, or use Win32::API

use Win32::API; BEGIN { Win32::API::->Import("user32","DWORD GetWindowThreadProcessId( HWN +D hWnd, LPDWORD lpdwProcessId)") or die $^E; }

Replies are listed 'Best First'.
Re^2: Win32::GuiTest process id
by leonidlm (Pilgrim) on Nov 12, 2009 at 13:20 UTC
    Thank you. I used the second approach.
    And to share that knowledge with other monks I attach the final code I used:
    use Win32::API; use Win32::guiTest qw( :ALL ); my ($repMainWindow) = FindWindowLike(undef, "Caption") or die $!; Win32::API::->Import("user32","DWORD GetWindowThreadProcessId( HWND hW +nd, LPDWORD lpdwProcessId)") or die $^E; my $pidLPDWORDStruct = pack( "L", 0 ); GetWindowThreadProcessId($repMainWindow, $pidLPDWORDStruct); my ($pid) = unpack ("L", $pidLPDWORDStruct);
    Thanks for everyone who helped!