1480Re: PushChildButton Not actually firing the event handler related to the button
- Aug 22, 2006PushButton does not works totally though, but PushChildButton works
now. I don't know what the '&' does to '&Next'?
So the text on the next button is like "Next >" while on the finish
button is "Finish." As you suggested I used '&Next' and the script
worked fine. Now if I use '&Finish' nothing happens but if I
use 'Finish' the button gets pushed. What is it doing behind the
[If you are wondering where do I use them, I use them right
PushChildButton($windowHandle, '&Next', '0.25');
PushChildButton($windowHandle, 'Finish', '0.25');
And Thanks for the suggestion of '&Next' Its working (for now
--- In email@example.com, "Santosh Kumar"
>consistency (I never faced any issue) with the same "Add Hardware
> Try using PushButton instead of PushChildButton.
> Check this code snippet to click Next button, it works with better
> my $Window = 'Add hardware Wizard';
> my @WHdls = FindWindowLike(0, $Window, "" );
> my $hwnd = $WHdls; # Window handle
> SetForegroundWindow( $hwnd ); # Get Add Hardware Wizard to front
> my $result = PushButton( '&Next', '0.5' ); #Click Next with 0.5seconds of delay.
> #Now wait for next window, or what ever you want.loosing focus / active status while you are sending the
> I suppose, issue you are facing could be due to parent window
>event handler related to the button
> ----- Original Message -----
> From: paramsan1234
> To: firstname.lastname@example.org
> Sent: Tuesday, August 22, 2006 11:51 AM
> Subject: [perlguitest] PushChildButton Not actually firing the
> Hi all!
> My situation:
> I am new to perl. I use Win32::GuiTest to achieve some
> for windows (!!!) popping up "Add New Hardware Wizard".1200);
> Code Snippet:
> use Win32::GuiTest qw(WaitWindowLike PushChildButton SendKeys)
> $Win32::GuiTest::debug = 1; # Set Debugging
> $WinHandle = WaitWindowLike(undef, "^Add New Hardware", "", "",
> # Set a timeout for 1200 secondsthis
> PushChildButton($WinHandle, "Next >", 0.25);
> # Set delay of 250ms for debugging
> # Don't worry about the syntax or compile errors in the code,
> # should serve as a pseudo code to actually what I am doing sincelast
> # screen-scraping, which is why I am using Win32::GuiTest is my
> # alternative though I know Win32::GuiTest is extremely usefulthe "Next >"
> # for thousands of windows errands/problems
> The code is as complex as it gets above (an irony, acutally it's
> simple though!). However the real issue is that sometimes
> button gets pushed and sometimes not. So I tried some detailedit
> checking and figured out that PushChildButton is returning a true
> value (1) means that it did it's work though I can't actually see
> press the button and neither does the window proceeds to the nextstep.
> However, I want a bit consistency in my program and want to makesure
> that it should work for the 99 % of cases (getting realistic ofsome
> other conditions)why
> I haven't seen the bug reports in detail though but I am not sure
> my code will be doing this. It seems as if something isinterfering
> between the time the PushChildButton's action is sent and theevent
> handler is kicked off. While, I have seen it work and not work inthe
> same conditions? Or this might not be a bug at all but somewindows thing?
> If any of you went throught the same problem, please help me
> to as why is this happening and how can I make sure that the Next(window) id
> button is pressed and the correct event takes place?
> Future Effort:
> The next part I am going to try is to put the child button
> instead of the text and;free
> try using sendMessage(...) somehow?
> Fine Print:
> If any of you had any similar threads posted before, please feel
> to redirect me to the correct place and if anything is not clear,I
> should try to correct my programming english considering the factthat
> I have just dived into the ocean and is still swimming near theshore.
> Thanking all,
> [Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>