乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      _ControlGetHandleByPos() UDF (v1.0)

       dinghj 2019-04-16

      No the reason I was getting the zero return for some controls was that your script did not seem to handle Edit 2 etc they were being renamed as Edit 1

      I have modified the script slightly and this seemed to work for me

      ; ==============================================================================
      ;
      ; Function Name:    _ControlGetHandleByPos()
      ; Description:    Retrieves the internal handle of a control that matches a
      ;                  given position.
      ; Parameter(s):  $sTitle -- the title of the window containing the control
      ;                  $sText  -- the text of the window containing the control
      ;                  $iX   -- the X coordinate of the control
      ;                  $IY   -- the Y coordinate of the control
      ; Requirement(s):   None
      ; Return Value(s):  On success -- returns the control's handle
      ;                  On failure -- return and sets @error:
      ;                                  1 -- could not find window
      ;                                  2 -- could not find control
      ; Author(s):        Alex Peters
      ;
      ; ==============================================================================
      
      Func _ControlGetHandleByPos($sTitle, $sText, $iX, $iY)
      
          Local $hWin, $hControl
          Local $iControls, $iLoop, $iUniqueControls
          Local $sClassList, $sClass, $sClassID
          Local $aiControlPos, $avUniqueControls[1][2]
      
      ; Determine that the window exists
          $hWin = WinGetHandle($sTitle, $sText)
          If @error Then
              SetError(2)
              Return 0
          EndIf
      
      ; Determine the control classes and total number of controls
          $sClassList = WinGetClassList($hWin)
          $iControls = StringLen($sClassList) - StringLen(StringReplace($sClassList, @LF, ""))
          ReDim $avUniqueControls[$iControls][2]
      
          $iUniqueControls = 0
          While $sClassList
              $sClass = StringLeft($sClassList, StringInStr($sClassList, @LF) - 1)
              $sClassList = StringMid($sClassList, StringLen($sClass) + 2)
              $sClassID = ""
              For $iLoop = 0 To $iUniqueControls - 1
                  If $avUniqueControls[$iLoop][0] = $sClass Then;If there is another button then make button 2 loop
                      $avUniqueControls[$iLoop][1] = $avUniqueControls[$iLoop][1] + 1;Starts at 0 then increments 1 each time a match is made giving button 2 etc
                      $sClassID = $sClass & $avUniqueControls[$iLoop][1];Makes up the correct class ID from above
                      ExitLoop
                  EndIf
              Next
      
              If $sClassID = "" Then;This numbers the first controls eg Edit 1
                  $avUniqueControls[$iUniqueControls][0] = $sClass
                  $avUniqueControls[$iUniqueControls][1] = 1
                  $iUniqueControls = $iUniqueControls + 1
                  $sClassID = $sClass & "1"
              EndIf
          ; Determine the position of the control in question
              $hControl = ControlGetHandle($hWin, "", $sClassID)
              $aiControlPos = ControlGetPos($hWin, "", $hControl)
              
              If ($aiControlPos[0] = $iX And $aiControlPos[1] = $iY) Then _ 
                      Return $hControl
          WEnd
      
      ; If we reach this point then no matching control was found
          SetError(1)
          Return 0
      
      EndFunc

      The If Not section did not seem to be working for me so I changed it to

      If $sClassID = ""
      and this seems to work.         

        本站是提供個人知識管理的網(wǎng)絡存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多