Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Win32::GuiTest process id

by Anonymous Monk
on Nov 11, 2009 at 18:50 UTC ( [id://806573]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://806573]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2026-04-18 20:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.