Announcement

Collapse
No announcement yet.

Window Find bug ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Window Find bug ?

    Can someone confirm this please:

    <font color=blue>On Application Close
    %hWnd% = Window.Find "Untitled - Notepad"
    Result = Dialog.MessageBox "%hWnd%"
    %PreventApplicationClose% = TRUE</font color=blue>

    Test this without Notepad open and get Result = %hWnd%
    Open notepad and Result = 6422722 etc.
    Close notepad and Result still = 6422722

    For your convenience:<font color=green>
    <IR_ACTIONS_LIST>
    <Action name="Find">
    <Type>127</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>0</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <FindText>Untitled - Notepad</FindText>
    <Variable>%hWnd%</Variable>
    </Action>
    <Action name="Message Box">
    <Type>5</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <DialogTitle>Title</DialogTitle>
    <DialogMessage>%hWnd%</DialogMessage>
    <Icon>3</Icon>
    <Variable>%Result%</Variable>
    <DialogType>0</DialogType>
    <DefaultButton>0</DefaultButton>
    </Action>
    <Action name="Set Value">
    <Type>6</Type>
    <Function>0</Function>
    <DTIndentLevel>0</DTIndentLevel>
    <Enabled>1</Enabled>
    <ErrorHandling>
    <UserNotificationMode>2</UserNotificationMode>
    <CustomErrorMessage/>
    <OnErrorAction>0</OnErrorAction>
    <JumpToLabel/>
    </ErrorHandling>
    <Variable>%PreventApplicationClose%</Variable>
    <Value>TRUE</Value>
    <Evaluate>0</Evaluate>
    </Action>
    </IR_ACTIONS_LIST></font color=green>
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

  • #2
    Re: Window Find bug ?

    Hello?? Anyone??

    Is this a bug or by design?
    [would be a bit strange if it was by design]
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

    Comment


    • #3
      Re: Window Find bug ?

      When I tried this, without Notepad open, is listed the variable as %hwnd%, but with it open it returns a value of 5384088. When I close notepad, %hwnd% is still set to 5384088. don't know what to tell ya.
      TJ-Tigger
      "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
      "Draco dormiens nunquam titillandus."
      Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

      Comment


      • #4
        Re: Window Find bug ?

        The second time around, the Window.Find action fails, since no window with "Untitled - Notepad" in the title bar can be found.

        When an action fails, the variable is left alone.

        All you're seeing is %hWnd% still having the same value it used to.

        Add a line like %hWnd% = "FOO" above those actions (to set a default value for %hWnd% first), and you'll see what I mean.
        --[[ Indigo Rose Software Developer ]]

        Comment


        • #5
          Re: Window Find bug ?

          I just remembered. A variable will not change if the item is not found. So once the value from Window.Find was set to the %%hWnd% it remains that way until set differently. try this one.

          <IR_ACTIONS_LIST>
          <Action name="Set Value">
          <Type>6</Type>
          <Function>0</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <Variable>%hWnd%</Variable>
          <Value>Default</Value>
          <Evaluate>0</Evaluate>
          </Action>
          <Action name="Find">
          <Type>127</Type>
          <Function>0</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>0</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <FindText>Untitled - Notepad</FindText>
          <Variable>%hWnd%</Variable>
          </Action>
          <Action name="IF">
          <Type>200</Type>
          <Function>1</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <Condition>%hWnd% != "Default"</Condition>
          </Action>
          <Action name="Message Box">
          <Type>5</Type>
          <Function>0</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <DialogTitle>Title</DialogTitle>
          <DialogMessage>%hWnd%</DialogMessage>
          <Icon>3</Icon>
          <Variable>%Result%</Variable>
          <DialogType>0</DialogType>
          <DefaultButton>0</DefaultButton>
          </Action>
          <Action name="Set Value">
          <Type>6</Type>
          <Function>0</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          <Variable>%PreventApplicationClose%</Variable>
          <Value>TRUE</Value>
          <Evaluate>0</Evaluate>
          </Action>
          <Action name="END IF">
          <Type>201</Type>
          <Function>1</Function>
          <DTIndentLevel>0</DTIndentLevel>
          <Enabled>1</Enabled>
          <ErrorHandling>
          <UserNotificationMode>2</UserNotificationMode>
          <CustomErrorMessage/>
          <OnErrorAction>0</OnErrorAction>
          <JumpToLabel/>
          </ErrorHandling>
          </Action>
          </IR_ACTIONS_LIST>
          TJ-Tigger
          "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
          "Draco dormiens nunquam titillandus."
          Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

          Comment


          • #6
            Re: Window Find bug ?

            ya beat me to it
            TJ-Tigger
            "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
            "Draco dormiens nunquam titillandus."
            Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

            Comment


            • #7
              Re: Window Find bug ?

              I must be having a 'Writers Block' period in life and having a hard time with this one:

              Actions follow the logic:

              On Application Close -
              %hWnd% = FOO
              %hWnd% = Window.Find "Untitled - Notepad"
              <font color=blue>IF [%hWnd% != FOO]</font color=blue>
              %PreventApplicationClose% = TRUE
              <font color=blue>ELSE</font color=blue>
              Application.Exit
              <font color=blue>END IF </font color=blue>

              This works fine until I open Notepad. when I close Notepad, the runtime will not exit. Dropping in a msgbox tells me %hWnd% is now stuck on FOO after it showing as 3663373 [etc] when Notepad was open. Something isnt working right! [img]/ubbthreads/images/icons/frown.gif[/img]
              I also tried the other way around [for the sake of it]:

              <font color=blue>IF [%hWnd% = FOO]</font color=blue>
              Application.Exit
              <font color=blue>ELSE</font color=blue>
              %PreventApplicationClose% = TRUE
              <font color=blue>END IF </font color=blue>

              ... the runtime will not close.
              -
              = Derek
              ["All glory comes from daring to begin" - fortune cookie]

              Comment


              • #8
                Re: Window Find bug ?

                [img]/ubbthreads/images/icons/smile.gif[/img]

                Once %PreventApplicationClose% is set to TRUE, your application won't close until you set it back to FALSE. The Application.Exit is probably happening, but it's having no effect...
                --[[ Indigo Rose Software Developer ]]

                Comment


                • #9
                  Re: Window Find bug ?

                  Oh! Shux - yes, i forgot that. Thanx, Lorne. [img]/ubbthreads/images/icons/smile.gif[/img]
                  -
                  = Derek
                  ["All glory comes from daring to begin" - fortune cookie]

                  Comment

                  Working...
                  X