Loading ...
Sorry, an error occurred while loading the content.

164Re: IsWindowEnabled

Expand Messages
  • Dennis K. Paulsen <ctrondlpaulsden@yahoo
    Feb 28, 2003
      The following example checks the enabled state of Calculator's
      Backspace button, try something similar for your purposes:

      # Tested under Win32::GuiTest (v 1.49.2)
      use Win32::GuiTest qw/

      # Start and then wait for calculator window to appear
      system("start calc.exe");
      WaitWindowLike(0, "Calculator", "");

      # Find Calculator window
      my ($CalcWin) = FindWindowLike(0, "Calculator", "");

      # Find Backspace button(window) belonging to Calculator window
      my ($BackSpace) = FindWindowLike($CalcWin, "Backspace", "");

      # See if Backspace button is enabled; which it should be
      if (IsWindowEnabled($BackSpace)) {
      print "BackSpace is enabled.\n";
      } else {
      # Backspace should be enabled. If not, die here.
      die "BackSpace is not enabled!";

      Dennis K. Paulsen

      --- In perlguitest@yahoogroups.com, "byronkat <byronkat@y...>"
      <byronkat@y...> wrote:
      > I'm trying to check to see if a button is enabled or disabled.
      > seen that the IsWindowEnabled method can be used. Does anyone
      > how to use this method? Thanks!
    • Show all 7 messages in this topic