找回密码
 加入
搜索
查看: 2567|回复: 0

[AU3基础] 紧急求助:AU3迷惑编译出错

[复制链接]
发表于 2015-6-18 20:30:28 | 显示全部楼层 |阅读模式
使用autoit v3 au3.cc  中文版,进行代码迷惑编译出现如下错误 :
我是包含了一个udf文件,这上面报错的,就是这个udf的错误,但用这个udf进行其他编译,没有出错,,,不知道什么原因

>运行 Obfuscator 代码迷惑 (1.0.31.1)  从:C:\Program Files (x86)\AutoIt3\SciTE\Obfuscator 命令行:
-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: __GUICtrl_SOH_Call
C:\Users\Administrator\Desktop\UQD\UQD.au3(2963,1) Warning for line:Local $iRet = Call($sFunction)

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: __GUICtrl_SOH_Call
C:\Users\Administrator\Desktop\UQD\UQD.au3(2967,1) Warning for line:$iRet = Call($sFunction, $sParam1)

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: __GUICtrl_SOH_Call
C:\Users\Administrator\Desktop\UQD\UQD.au3(2971,1) Warning for line:$iRet = Call($sFunction, $sParam1, $sParam2)

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: __GUICtrl_SOH_Call
C:\Users\Administrator\Desktop\UQD\UQD.au3(2975,1) Warning for line:$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3)

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: __GUICtrl_SOH_Call
C:\Users\Administrator\Desktop\UQD\UQD.au3(2979,1) Warning for line:$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4)

-### StripOnly/StripFunc Error: Found Call() statement using unsolvable Func, which will/could lead to removal of Funcs that are used by this Function.
>### current Func: __GUICtrl_SOH_Call
C:\Users\Administrator\Desktop\UQD\UQD.au3(2983,1) Warning for line:$iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4, $sParam5)

-#############################################################################################
-#### Obfuscator Found   6 Error(s)!!!!    This means your script could have problems running properly.  ####
-#############################################################################################
- Iteration 1 Strip Functions result: Output  4816 lines and stripped 0 lines
- Iteration 2 Strip Variables result: Output  1892 lines and stripped 2924 lines
- Iteration 3 Strip Variables result: Output  1806 lines and stripped 86 lines
- Iteration 4 Strip Variables result: Output  1798 lines and stripped 8 lines
- Iteration 5 Start the actual Obfuscation.
-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Users\ADMINI~1\AppData\Local\Temp\OBs55A6.tmp(502,1) Warning for line:$s__GUICtrl_SOH_OnExitFunc = Execute('Opt("OnExitFunc", "__GUICtrl_SOH_Exit")')

-###2 Obfuscation Error: Found Execute() statement which will lead to problems running your obfuscated script.
>### current Func: Main Script
C:\Users\ADMINI~1\AppData\Local\Temp\OBs55A6.tmp(504,1) Warning for line:Execute('OnAutoItExitRegister("__GUICtrl_SOH_Exit")')


下面附上这个udf代码:
  1. #region Header

  2. #include-once

  3. #CS UDF Info
  4.        
  5.         Name.........:      GUICtrlOnHover.au3
  6.         Forum link...:      http://www.autoitscript.com/forum/index.php?s=&showtopic=55120
  7.         Author.......:      G.Sandler a.k.a MrCreatoR (CreatoR's Lab, www.creator-lab.ucoz.ru, www.autoit-script.ru)
  8.         Remarks......:
  9.         1)        TreeView/ListView Items can not be set :(.
  10.         2)        When the window is not active, the hover/leave hover functions will still called, but not when the window is disabled.
  11.         3)        The hover/leave hover functions will be called even if the script is paused by such functions as MsgBox().
  12.         4)        The $sHover_Func/$sLeaveHover_Func functions should not introduce significant delays in the main script,
  13.         for example by calling functions like Sleep() or MsgBox().
  14.         5) IMPORTANT!
  15.         A)        Do not call _GUICtrl_OnHoverRegister inside $sHover_Func/$sLeaveHover_Func functions, it's not a good idea.
  16.        
  17.         B)        This UDF registering WM_COMMAND and WM_LBUTTONDOWN window messages.
  18.         Please ensure that those messages are not used after including this library,
  19.         if they do, you will have to call __GUICtrl_SOH_WM_COMMAND and __GUICtrl_SOH_WM_LBUTTONDOWN inside those functions. Example:
  20.        
  21.         Func MY_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
  22.         __GUICtrl_SOH_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
  23.         ...
  24.         EndFunc
  25.        
  26.        
  27.         *** Version History ***
  28.        
  29.         [v2.0] - [09.06.2010]
  30.         * Fixed potential issue with calling $sPrimaryDownFunc function (first call was performed only after recieving WM_COMMAND message, wich is the control event).
  31.         * Fixed an issue with blocking the OnHover function - the OnLeaveHover function was not called untill the OnHover function was blocked.
  32.         * Fixed(?) (again) issue when the UDF is not working under 64-bit OS.
  33.         * Optimized internal "__GUICtrl_SOH_Call" function to work faster when calling parameters functions.
  34.        
  35.         [v1.9] - [21.05.2010]
  36.         * UDF library now compatible with AutoIt 3.3.6.1.
  37.         * UDF library renamed to GUICtrlOnHover.au3.
  38.         * Changed the main function name to _GUICtrl_OnHoverRegister, For backwards compatibility reasons, other (old) function names are still supported:
  39.         _GUICtrl_SetOnHover, GUICtrl_SetOnHover, GUICtrlSetOnHover, _GUICtrlSetOnHover
  40.        
  41.         * Fixed(?) issue when the UDF is not working under 64-bit OS.
  42.         * Global variables and internal functions renaming (for "cosmetic" reasons only).
  43.         * UDF's code is more readable now.
  44.        
  45.        
  46.         [v1.8] - [28.09.2009]
  47.         * Few Global variables now have more unique name.
  48.         * Fixed an issue with false calling of function on PrimaryDown event.
  49.         I.e when the user clicks on other place (not on the hovered control) and drag the cursor to the control, the PrimaryDown function was called.
  50.         * Due to (and as a result of) previous issue, the UDF now registering WM_COMMAND and WM_LBUTTONDOWN messages at first UDF call.
  51.        
  52.        
  53.         [v1.7] - [07.07.2009]
  54.         + Added _GUICtrl_SetHoverOnBackWindow...
  55.         Allows to set the hovering mode:
  56.         $iSetBackWin = 1 (default) hovering process will proceed even when GUI is not active (in background).
  57.         $iSetBackWin <> 1 hovering process will NOT proceed when GUI is not active.
  58.        
  59.        
  60.         [v1.6] - [12.06.2009]
  61.         * Now the UDF compatible with scripts (or other udfs) that uses OnAutoItExit function.
  62.         i.e: "OnAutoItExit" function that was *previously* set by user will be called as well.
  63.        
  64.         + Added new parameter $iKeepCall_Hover_Func. If this parameter = 1,
  65.         then the $sHover_Func function *Will* be called constantly untill the control is no longer been hovered
  66.         (default is 0, do not call the function constantly).
  67.         + Added new arguments to calling function...
  68.         The OnPrimaryDown/Up function now can recieve one more argument:
  69.         $iClickMode - Defines the Click mode (1 - Pressed, 2 - Released)
  70.        
  71.         * Changed return value - function will return 2 when $iCtrlID is redefined (ReSet, already exists in the controls list).
  72.         * Fixed incorrect documentation parts.
  73.         * Fixed "OnClick" handeling. When using multiple GUIs, the active gui was not recognized properly.
  74.         * Fixed(?) bug with "dimension range exceeded" when trying to UnSet a Control.
  75.        
  76.         [v1.5]
  77.         + Added AutoIt 3.2.10.0+ support, but 3.2.8.1 or less is dropped :( (due to lack of native CallBack functions).
  78.         + Added Primary Down and Primary Up support. Helping to handle with the buttons pressing.
  79.         + Added new arguments to calling function...
  80.         The OnHover function now can recieve two more arguments:
  81.         $iHoverMode - Defines the hover mode (1 - Hover, 2 - Leaves Hovering)
  82.         $hWnd_Hovered - Control Handle where the mouse is moved to (after hovering).
  83.        
  84.         * Almost all code of this UDF was rewritted.
  85.         * Now the main function name is _GUICtrl_SetOnHover(),
  86.         but for backwards compatibility reasons, other (old) function names are still supported.
  87.         * Fixed bug with hovering controls in other apps.
  88.         * Improvements in generaly, the UDF working more stable now.
  89.        
  90.         [v1.?]
  91.         * Beta changes, see "Forum link" for more details.
  92.        
  93.         [v1.0]
  94.         * First release.
  95.        
  96. #CE

  97. #endregion Header

  98. #region Internal Global Variables

  99. Global $a__GUICtrl_SOH_Ctrls[1][1]
  100. Global $a__GUICtrl_SOH_LastHoveredElements[2] = [-1, -1]
  101. Global $a__GUICtrl_SOH_LastHoveredElementsMark = -1
  102. Global $h__GUICtrl_SOH_LastClickedElementMark = -1
  103. Global $i__GUICtrl_SOH_CtrlsModified = 0
  104. Global $i__GUICtrl_SOH_HoverOnBackWin = 1
  105. Global $i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0

  106. Global $p__GUICtrl_SOH_TimerProc = 0
  107. Global $i__GUICtrl_SOH_TimerID = 0

  108. Global $s__GUICtrl_SOH_User32_Dll = @SystemDir & "\User32.dll"
  109. Global $s__GUICtrl_SOH_OnExitFunc = ""

  110. If @AutoItVersion < "3.3.2.0" Then
  111.         $s__GUICtrl_SOH_OnExitFunc = Execute('Opt("OnExitFunc", "__GUICtrl_SOH_Exit")')
  112. Else
  113.         Execute('OnAutoItExitRegister("__GUICtrl_SOH_Exit")')
  114. EndIf

  115. Global Const $n__GUICtrl_SOH_WM_COMMAND = 0x0111
  116. Global Const $n__GUICtrl_SOH_WM_LBUTTONDOWN = 0x0201

  117. #endregion Internal Global Variables

  118. #region Public Functions

  119. ; #FUNCTION# ====================================================================================================
  120. ; Name...........:        _GUICtrl_OnHoverRegister
  121. ; Description....:        Registers a function to be called when GUI elements been hovered.
  122. ; Syntax.........:        _GUICtrl_OnHoverRegister($iCtrlID [, $sHover_Func="" [, $sLeaveHover_Func=-1 [, $sPrimaryDownFunc=-1 [, $sPrimaryUpFunc=-1 [, $iKeepCall_PrDn_Func=1 [, $iKeepCall_Hover_Func=0 ]]]]]])
  123. ;
  124. ; Parameters.....:        $iCtrlID              - The Ctrl ID to set hovering for (can be a -1 as indication to the last item created).
  125. ;
  126. ;                   $sHover_Func          - [Optional] Function to call when the mouse is hovering the control.
  127. ;                                             If this parameter passed as empty string (""),
  128. ;                                             then the specified CtrlID is UnSet from Hovering Handler list.
  129. ;
  130. ;                   $sLeaveHover_Func     - [Optional] Function to call when the mouse is leaving hovering the control
  131. ;                       (-1 no function used).
  132. ;                     * For both parameters, $sHover_FuncName and $sLeaveHover_FuncName,
  133. ;                       the specified function called with maximum 3 parameters:
  134. ;                                                     $iCtrlID      - CtrlID of hovered control.
  135. ;                                                     $iHoverMode   - Defines the hover mode (1 - Hover, 2 - Leaves Hovering).
  136. ;                                                     $hWnd_Hovered - Control Handle where the mouse is moved to (after hovering).
  137. ;
  138. ;                   $sPrimaryDownFunc     - [Optional] Function to call when Primary mouse button is *clicked* on the control.
  139. ;                       (-1 -> function is not called).
  140. ;
  141. ;                   $sPrimaryUpFunc       - [Optional] Function to call when Primary mouse button is *released* the control.
  142. ;                       (-1 -> function is not called).
  143. ;
  144. ;                     * For both parameters, $sPrimaryDownFunc and $sPrimaryUpFunc,
  145. ;                       the specified function called with maximum 2 parameters:
  146. ;                                                     $iCtrlID      - CtrlID of clicked control.
  147. ;                                                     $iClickMode   - Defines the click mode (1 - Pressed, 2 - Released).
  148. ;
  149. ;                   $iKeepCall_PrDn_Func  - [Optional] If this parameter < 1,
  150. ;                                            then the $sPrimaryDownFunc function will *Not* be called constantly untill
  151. ;                                            the primary mouse button is released (default behaviour - $iKeepCall_PrDn_Func = 1).
  152. ;
  153. ;                   $iKeepCall_Hover_Func - [Optional] If this parameter = 1,
  154. ;                                            then the $sHover_Func function *Will* be called constantly untill
  155. ;                                            the control is no longer been hovered (default behaviour - $iKeepCall_Hover_Func = 0).
  156. ;
  157. ; Return values..:        Success               - Returns 1 if the function registered succesefully.
  158. ;                                           When $iCtrlID is redefined (ReSet, already exists in the controls list), the return value is 2.
  159. ;                                        Failure               - Set @error to 1 and return 0 if $iCtrlID is not a GUI Control Identifier.
  160. ;
  161. ; Author.........:        G.Sandler (a.k.a CreatoR), www.creator-lab.ucoz.ru, www.autoit-script.ru.
  162. ; Modified.......:
  163. ; Remarks........:        1) TreeView/ListView Items can not be set :(.
  164. ;                   2) When the window is not active, the hover/leave hover functions will still called, but not when the window is disabled.
  165. ;                   3) The hover/leave hover functions will be called even if the script is paused by such functions as MsgBox().
  166. ;                   4) The $sHover_Func/$sLeaveHover_Func functions should not introduce significant delays in the main script,
  167. ;                      for example by calling functions like Sleep() or MsgBox().
  168. ;                   5) IMPORTANT!
  169. ;                      A) Do not call _GUICtrl_OnHoverRegister inside $sHover_Func/$sLeaveHover_Func functions, it's not a good idea.
  170. ;
  171. ;                      B) This UDF registering WM_COMMAND and WM_LBUTTONDOWN window messages.
  172. ;                      Please ensure that those messages are not used after including this library,
  173. ;                      if they do, you will have to call __GUICtrl_SOH_WM_COMMAND and __GUICtrl_SOH_WM_LBUTTONDOWN inside those functions. Example:
  174. ;
  175. ;                                                        Func MY_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
  176. ;                                                                __GUICtrl_SOH_WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
  177. ;                                                                 ...
  178. ;                                                        EndFunc
  179. ;
  180. ; Related........:
  181. ; Link...........:        http://www.autoitscript.com/forum/index.php?s=&showtopic=55120
  182. ; Example........:        Yes.
  183. ; ===============================================================================================================
  184. Func _GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func = "", $sLeaveHover_Func = -1, $sPrimaryDownFunc = -1, $sPrimaryUpFunc = -1, $iKeepCall_PrDn_Func = 1, $iKeepCall_Hover_Func = 0)
  185.         Local $hCtrlID = GUICtrlGetHandle($iCtrlID)
  186.        
  187.         If Not $hCtrlID Then
  188.                 Return SetError(1, 0, 0)
  189.         EndIf
  190.        
  191.         If $p__GUICtrl_SOH_TimerProc = 0 Then
  192.                 $p__GUICtrl_SOH_TimerProc = DllCallbackRegister("__GUICtrl_SOH_CALLBACK", "none", "hwnd;int;uint_ptr;dword")
  193.                 $i__GUICtrl_SOH_TimerID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "SetTimer", _
  194.                                 "hwnd", 0, "uint_ptr", Round(TimerInit()), "uint", 30, "ptr", DllCallbackGetPtr($p__GUICtrl_SOH_TimerProc))
  195.                
  196.                 GUIRegisterMsg($n__GUICtrl_SOH_WM_COMMAND, "__GUICtrl_SOH_WM_COMMAND")
  197.                 GUIRegisterMsg($n__GUICtrl_SOH_WM_LBUTTONDOWN, "__GUICtrl_SOH_WM_LBUTTONDOWN")
  198.                
  199.                 If IsArray($i__GUICtrl_SOH_TimerID) Then
  200.                         $i__GUICtrl_SOH_TimerID = $i__GUICtrl_SOH_TimerID[0]
  201.                 EndIf
  202.         EndIf
  203.        
  204.         ;UnSet Hovering for specified control (remove control id from hovering checking process)
  205.         If $sHover_Func = "" And @NumParams <= 2 Then
  206.                 Local $a__GUICtrl_SOH_Ctrls_Tmp[1][1]
  207.                 Local $a__GUICtrl_SOH_Ctrls_Swap = $a__GUICtrl_SOH_Ctrls ;This one prevents a bug with "dimension range exceeded"
  208.                
  209.                 For $i = 1 To $a__GUICtrl_SOH_Ctrls_Swap[0][0]
  210.                         If $hCtrlID <> $a__GUICtrl_SOH_Ctrls_Swap[$i][0] Then
  211.                                 $a__GUICtrl_SOH_Ctrls_Tmp[0][0] += 1
  212.                                 ReDim $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0] + 1][7]
  213.                                
  214.                                 $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][0] = $a__GUICtrl_SOH_Ctrls_Swap[$i][0]
  215.                                 $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][1] = $a__GUICtrl_SOH_Ctrls_Swap[$i][1]
  216.                                 $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][2] = $a__GUICtrl_SOH_Ctrls_Swap[$i][2]
  217.                                 $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][3] = $a__GUICtrl_SOH_Ctrls_Swap[$i][3]
  218.                                 $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][4] = $a__GUICtrl_SOH_Ctrls_Swap[$i][4]
  219.                                 $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][5] = $a__GUICtrl_SOH_Ctrls_Swap[$i][5]
  220.                                 $a__GUICtrl_SOH_Ctrls_Tmp[$a__GUICtrl_SOH_Ctrls_Tmp[0][0]][6] = $a__GUICtrl_SOH_Ctrls_Swap[$i][6]
  221.                         EndIf
  222.                 Next
  223.                
  224.                 If $a__GUICtrl_SOH_Ctrls_Tmp[0][0] < 1 Then
  225.                         __GUICtrl_SOH_ReleaseResources() ;Release the callbacks
  226.                 Else
  227.                         $i__GUICtrl_SOH_CtrlsModified = 1
  228.                         $a__GUICtrl_SOH_Ctrls = $a__GUICtrl_SOH_Ctrls_Tmp
  229.                 EndIf
  230.                
  231.                 Return 1
  232.         EndIf
  233.        
  234.         ;Check if the hovering process already handle the passed CtrlID, if so, just assign new values (functions)
  235.         For $i = 1 To $a__GUICtrl_SOH_Ctrls[0][0]
  236.                 If $hCtrlID = $a__GUICtrl_SOH_Ctrls[$i][0] Then
  237.                         $a__GUICtrl_SOH_Ctrls[$i][0] = $hCtrlID
  238.                         $a__GUICtrl_SOH_Ctrls[$i][1] = $sHover_Func
  239.                         $a__GUICtrl_SOH_Ctrls[$i][2] = $sLeaveHover_Func
  240.                         $a__GUICtrl_SOH_Ctrls[$i][3] = $sPrimaryDownFunc
  241.                         $a__GUICtrl_SOH_Ctrls[$i][4] = $sPrimaryUpFunc
  242.                         $a__GUICtrl_SOH_Ctrls[$i][5] = $iKeepCall_PrDn_Func
  243.                         $a__GUICtrl_SOH_Ctrls[$i][6] = $iKeepCall_Hover_Func
  244.                        
  245.                         Return 2
  246.                 EndIf
  247.         Next
  248.        
  249.         $a__GUICtrl_SOH_Ctrls[0][0] += 1
  250.         ReDim $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0] + 1][7]
  251.        
  252.         $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][0] = $hCtrlID
  253.         $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][1] = $sHover_Func
  254.         $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][2] = $sLeaveHover_Func
  255.         $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][3] = $sPrimaryDownFunc
  256.         $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][4] = $sPrimaryUpFunc
  257.         $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][5] = $iKeepCall_PrDn_Func
  258.         $a__GUICtrl_SOH_Ctrls[$a__GUICtrl_SOH_Ctrls[0][0]][6] = $iKeepCall_Hover_Func
  259.        
  260.         Return 1
  261. EndFunc   ;==>_GUICtrl_OnHoverRegister

  262. ;Set the hovering mode:
  263. ;                      $iSetBackWin = 1 (default) hovering process will proceed even when GUI is not active (in background).
  264. ;                      $iSetBackWin <> 1 hovering process will NOT proceed when GUI is not active.
  265. Func _GUICtrl_SetHoverOnBackWindow($iSetBackWin)
  266.         $i__GUICtrl_SOH_HoverOnBackWin = Number($iSetBackWin = 1)
  267. EndFunc   ;==>_GUICtrl_SetHoverOnBackWindow

  268. #endregion Public Functions

  269. #region Backwards Compatibility Functions

  270. ;Backwards compatibility function #1
  271. Func _GUICtrl_SetOnHover($iCtrlID, $sHover_Func = "", $sLeaveHover_Func = -1, $sPrimaryDownFunc = -1, $sPrimaryUpFunc = -1, $iKeepCall_PrDn_Func = 1, $iKeepCall_Hover_Func = 0)
  272.         _GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
  273. EndFunc   ;==>_GUICtrl_SetOnHover

  274. ;Backwards compatibility function #2
  275. Func GUICtrl_SetOnHover($iCtrlID, $sHover_Func = "", $sLeaveHover_Func = -1, $sPrimaryDownFunc = -1, $sPrimaryUpFunc = -1, $iKeepCall_PrDn_Func = 1, $iKeepCall_Hover_Func = 0)
  276.         _GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
  277. EndFunc   ;==>GUICtrl_SetOnHover

  278. ;Backwards compatibility function #3
  279. Func GUICtrlSetOnHover($iCtrlID, $sHover_Func = "", $sLeaveHover_Func = -1, $sPrimaryDownFunc = -1, $sPrimaryUpFunc = -1, $iKeepCall_PrDn_Func = 1, $iKeepCall_Hover_Func = 0)
  280.         _GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
  281. EndFunc   ;==>GUICtrlSetOnHover

  282. ;Backwards compatibility function #4
  283. Func _GUICtrlSetOnHover($iCtrlID, $sHover_Func = "", $sLeaveHover_Func = -1, $sPrimaryDownFunc = -1, $sPrimaryUpFunc = -1, $iKeepCall_PrDn_Func = 1, $iKeepCall_Hover_Func = 0)
  284.         _GUICtrl_OnHoverRegister($iCtrlID, $sHover_Func, $sLeaveHover_Func, $sPrimaryDownFunc, $sPrimaryUpFunc, $iKeepCall_PrDn_Func, $iKeepCall_Hover_Func)
  285. EndFunc   ;==>_GUICtrlSetOnHover

  286. #endregion Backwards Compatibility Functions

  287. #region Internal Functions

  288. ;CallBack function to handle the hovering process
  289. Func __GUICtrl_SOH_CALLBACK($hWnd, $uiMsg, $idEvent, $dwTime)
  290.         $i__GUICtrl_SOH_CtrlsModified = 0
  291.        
  292.         If $a__GUICtrl_SOH_Ctrls[0][0] < 1 Then
  293.                 Return
  294.         EndIf
  295.        
  296.         If $i__GUICtrl_SOH_HoverOnBackWin Then
  297.                 Local $iControl_Hovered = __GUICtrl_SOH_ControlGetHovered()
  298.         Else
  299.                 Local $iControl_Hovered = GUIGetCursorInfo()
  300.                
  301.                 If Not IsArray($iControl_Hovered) Then
  302.                         Return
  303.                 EndIf
  304.                
  305.                 $iControl_Hovered = GUICtrlGetHandle($iControl_Hovered[4])
  306.         EndIf
  307.        
  308.         Local $sCheck_LHE = $a__GUICtrl_SOH_LastHoveredElements[1]
  309.         Local $iCheck_LCEM = $h__GUICtrl_SOH_LastClickedElementMark
  310.         Local $iCtrlID
  311.        
  312.         ;Leave Hovering Process and reset variables
  313.         If Not $iControl_Hovered Or ($sCheck_LHE <> -1 And $iControl_Hovered <> $sCheck_LHE) Then
  314.                 If $a__GUICtrl_SOH_LastHoveredElementsMark = -1 Then
  315.                         Return
  316.                 EndIf
  317.                
  318.                 Local $a__Tmp_GUICtrl_SOH_LastHoveredElements[2] = [$a__GUICtrl_SOH_LastHoveredElements[0], $a__GUICtrl_SOH_LastHoveredElements[1]]
  319.                
  320.                 $a__GUICtrl_SOH_LastHoveredElements[0] = -1
  321.                 $a__GUICtrl_SOH_LastHoveredElements[1] = -1
  322.                 $a__GUICtrl_SOH_LastHoveredElementsMark = -1
  323.                 $h__GUICtrl_SOH_LastClickedElementMark = -1
  324.                
  325.                 If $a__Tmp_GUICtrl_SOH_LastHoveredElements[0] <> -1 Then
  326.                         $iCtrlID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "GetDlgCtrlID", "hwnd", $a__Tmp_GUICtrl_SOH_LastHoveredElements[1])
  327.                        
  328.                         If IsArray($iCtrlID) Then
  329.                                 $iCtrlID = $iCtrlID[0]
  330.                         EndIf
  331.                        
  332.                         ;2 is the indicator of OnLeavHover process
  333.                         __GUICtrl_SOH_Call($a__Tmp_GUICtrl_SOH_LastHoveredElements[0], $iCtrlID, 2, $iControl_Hovered)
  334.                 EndIf
  335.         Else ;Hovering Process, Primary Down/Up handler, and set $a__GUICtrl_SOH_LastHoveredElements
  336.                 If $i__GUICtrl_SOH_CtrlsModified = 1 Then
  337.                         $i__GUICtrl_SOH_CtrlsModified = 0
  338.                         Return
  339.                 EndIf
  340.                
  341.                 Local $iUbound = UBound($a__GUICtrl_SOH_Ctrls) - 1
  342.                
  343.                 For $i = 1 To $a__GUICtrl_SOH_Ctrls[0][0]
  344.                         If $i > $iUbound Then
  345.                                 ExitLoop
  346.                         EndIf
  347.                        
  348.                         If $a__GUICtrl_SOH_Ctrls[$i][0] = $iControl_Hovered Then
  349.                                 $iCtrlID = DllCall($s__GUICtrl_SOH_User32_Dll, "int", "GetDlgCtrlID", "hwnd", $iControl_Hovered)
  350.                                
  351.                                 If IsArray($iCtrlID) Then
  352.                                         $iCtrlID = $iCtrlID[0]
  353.                                 EndIf
  354.                                
  355.                                 ;Primary Down/Up handler
  356.                                 If ($a__GUICtrl_SOH_Ctrls[$i][3] <> "" Or $a__GUICtrl_SOH_Ctrls[$i][4] <> "") And ($iCheck_LCEM = -1 Or $iCheck_LCEM = $iControl_Hovered) Then
  357.                                         Local $aCursorInfo = 0
  358.                                         Local $hParent_Wnd = DllCall($s__GUICtrl_SOH_User32_Dll, "hwnd", "GetParent", "hwnd", $iControl_Hovered)
  359.                                        
  360.                                         If Not @error And IsArray($hParent_Wnd) Then
  361.                                                 $hParent_Wnd = $hParent_Wnd[0]
  362.                                                 $aCursorInfo = GUIGetCursorInfo($hParent_Wnd)
  363.                                         Else
  364.                                                 $aCursorInfo = GUIGetCursorInfo()
  365.                                         EndIf
  366.                                        
  367.                                         If IsArray($aCursorInfo) Then
  368.                                                 ;Primary Down...
  369.                                                 ;* First condition is to prevent function call when holding down m.button from other control
  370.                                                 ;* Last condition is to Prevent/Allow multiple function call
  371.                                                 ;(depending on $iKeepCall_PrDn_Func param).
  372.                                                 If ($i__GUICtrl_SOH_LastPrimaryDownCtrlID = $iControl_Hovered Or $i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0) And WinActive($hParent_Wnd) And _
  373.                                                                 $aCursorInfo[2] = 1 And $a__GUICtrl_SOH_Ctrls[$i][3] <> -1 And _
  374.                                                                 (($a__GUICtrl_SOH_Ctrls[$i][5] < 1 And $iCheck_LCEM <> $iControl_Hovered) Or $a__GUICtrl_SOH_Ctrls[$i][5] > 0) Then
  375.                                                        
  376.                                                         ;1 is the indicator of Primary*Down* event
  377.                                                         __GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][3], $iCtrlID, 1)
  378.                                                        
  379.                                                         $h__GUICtrl_SOH_LastClickedElementMark = $iControl_Hovered
  380.                                                         ;Primary Up
  381.                                                 ElseIf $aCursorInfo[2] = 0 And $a__GUICtrl_SOH_Ctrls[$i][4] <> -1 And $iCheck_LCEM = $iControl_Hovered Then
  382.                                                         ;2 is the indicator of Primary*Up* event
  383.                                                         __GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][4], $iCtrlID, 2)
  384.                                                        
  385.                                                         $h__GUICtrl_SOH_LastClickedElementMark = -1
  386.                                                 EndIf
  387.                                         EndIf
  388.                                 EndIf
  389.                                
  390.                                 If $i__GUICtrl_SOH_CtrlsModified = 1 Then
  391.                                         ExitLoop
  392.                                 EndIf
  393.                                
  394.                                 If $a__GUICtrl_SOH_Ctrls[$i][6] < 1 And $a__GUICtrl_SOH_LastHoveredElementsMark = $a__GUICtrl_SOH_Ctrls[$i][0] Then
  395.                                         ExitLoop
  396.                                 Else
  397.                                         $a__GUICtrl_SOH_LastHoveredElementsMark = $a__GUICtrl_SOH_Ctrls[$i][0]
  398.                                 EndIf
  399.                                
  400.                                 If $a__GUICtrl_SOH_Ctrls[$i][2] <> -1 Then
  401.                                         $a__GUICtrl_SOH_LastHoveredElements[0] = $a__GUICtrl_SOH_Ctrls[$i][2]
  402.                                         $a__GUICtrl_SOH_LastHoveredElements[1] = $iControl_Hovered
  403.                                 EndIf
  404.                                
  405.                                 __GUICtrl_SOH_Call($a__GUICtrl_SOH_Ctrls[$i][1], $iCtrlID, 1, 0) ;1 is the indicator of OnHover process
  406.                                
  407.                                 If $i__GUICtrl_SOH_CtrlsModified = 1 Then
  408.                                         ExitLoop
  409.                                 EndIf
  410.                                
  411.                                 ExitLoop
  412.                         EndIf
  413.                 Next
  414.         EndIf
  415.        
  416.         $i__GUICtrl_SOH_CtrlsModified = 0
  417. EndFunc   ;==>__GUICtrl_SOH_CALLBACK

  418. Func __GUICtrl_SOH_WM_COMMAND($hWndGUI, $MsgID, $WParam, $LParam)
  419.         $i__GUICtrl_SOH_LastPrimaryDownCtrlID = $LParam
  420. ;~         Return WM_COMMAND($hWndGUI, $MsgID, $WParam, $LParam)
  421. EndFunc   ;==>__GUICtrl_SOH_WM_COMMAND

  422. Func __GUICtrl_SOH_WM_LBUTTONDOWN($hWndGUI, $MsgID, $WParam, $LParam)
  423.         $i__GUICtrl_SOH_LastPrimaryDownCtrlID = 0
  424. EndFunc   ;==>__GUICtrl_SOH_WM_LBUTTONDOWN

  425. ;Thanks to amel27 for that one!!!
  426. Func __GUICtrl_SOH_ControlGetHovered()
  427.         Local $iOld_Opt_MCM = Opt("MouseCoordMode", 1)
  428.         Local $tPoint = DllStructCreate("int X;int Y")
  429.         Local $aMPos = MouseGetPos()
  430.        
  431.         DllStructSetData($tPoint, "x", $aMPos[0])
  432.         DllStructSetData($tPoint, "y", $aMPos[1])
  433.        
  434.         Local $tPointCast = DllStructCreate("int64", DllStructGetPtr($tPoint))
  435.         Local $aRet = DllCall($s__GUICtrl_SOH_User32_Dll, "hwnd", "WindowFromPoint", "int64", DllStructGetData($tPointCast, 1))
  436.        
  437.         Opt("MouseCoordMode", $iOld_Opt_MCM)
  438.        
  439.         If @error Then
  440.                 Return SetError(@error, @extended, 0)
  441.         EndIf
  442.        
  443.         Return $aRet[0]
  444. EndFunc   ;==>__GUICtrl_SOH_ControlGetHovered

  445. ;Call() function wrapper
  446. Func __GUICtrl_SOH_Call($sFunction, $sParam1 = "", $sParam2 = "", $sParam3 = "", $sParam4 = "", $sParam5 = "")
  447.         Local $iRet = Call($sFunction)
  448.        
  449.         If @error <> 0xDEAD Then
  450.                 Return $iRet
  451.         EndIf
  452.        
  453.         $iRet = Call($sFunction, $sParam1)
  454.        
  455.         If @error <> 0xDEAD Then
  456.                 Return $iRet
  457.         EndIf
  458.        
  459.         $iRet = Call($sFunction, $sParam1, $sParam2)
  460.        
  461.         If @error <> 0xDEAD Then
  462.                 Return $iRet
  463.         EndIf
  464.        
  465.         $iRet = Call($sFunction, $sParam1, $sParam2, $sParam3)
  466.        
  467.         If @error <> 0xDEAD Then
  468.                 Return $iRet
  469.         EndIf
  470.        
  471.         $iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4)
  472.        
  473.         If @error <> 0xDEAD Then
  474.                 Return $iRet
  475.         EndIf
  476.        
  477.         $iRet = Call($sFunction, $sParam1, $sParam2, $sParam3, $sParam4, $sParam5)
  478.        
  479.         If @error <> 0xDEAD Then
  480.                 Return $iRet
  481.         EndIf
  482.        
  483.         Return SetError(1, 0, 0)
  484. EndFunc   ;==>__GUICtrl_SOH_Call

  485. ;Release resources function
  486. Func __GUICtrl_SOH_ReleaseResources()
  487.         If $p__GUICtrl_SOH_TimerProc > 0 Then
  488.                 DllCallbackFree($p__GUICtrl_SOH_TimerProc)
  489.         EndIf
  490.        
  491.         If $i__GUICtrl_SOH_TimerID > 0 Then
  492.                 DllCall($s__GUICtrl_SOH_User32_Dll, "int", "KillTimer", "hwnd", 0, "uint_ptr", $i__GUICtrl_SOH_TimerID)
  493.         EndIf
  494.        
  495.         GUIRegisterMsg($n__GUICtrl_SOH_WM_COMMAND, "")
  496.         GUIRegisterMsg($n__GUICtrl_SOH_WM_LBUTTONDOWN, "")
  497.        
  498.         $p__GUICtrl_SOH_TimerProc = 0
  499.         $i__GUICtrl_SOH_TimerID = 0
  500. EndFunc   ;==>__GUICtrl_SOH_ReleaseResources

  501. ;Release the CallBack resources when exit
  502. Func __GUICtrl_SOH_Exit()
  503.         If $s__GUICtrl_SOH_OnExitFunc <> "" Then
  504.                 Call($s__GUICtrl_SOH_OnExitFunc)
  505.         EndIf
  506.        
  507.         __GUICtrl_SOH_ReleaseResources()
  508. EndFunc   ;==>__GUICtrl_SOH_Exit

  509. #endregion Internal Functions
复制代码
不知原因何在,请教各位帮忙 解决,先谢谢了。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2026-9-25 04:17 , Processed in 0.103593 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表