Jump to content

Recommended Posts

Posted (edited)

The second parameters to SetTimer and KillTimer are UINT_PTR types which are 64-bit values on x64 Windows. Maybe the SetTimer function is failing, which would break the whole UDF. Also the return from WindowFromPoint is a hwnd, not int.

Edited by wraithdu
Posted

  On 5/20/2010 at 7:29 PM, 'wraithdu said:

The second parameters to SetTimer and KillTimer are UINT_PTR types which are 64-bit values on x64 Windows. Maybe the SetTimer function is failing, which would break the whole UDF. Also the return from WindowFromPoint is a hwnd, not int.

Thanks.

Rawox, billthecreator, Homes32

Can you please change what wraithdu suggesting and check it under x64?

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Ok, new version...

  Quote

[v1.9] - [21.05.2010]

* UDF library now compatible with AutoIt 3.3.6.1.

* UDF library renamed to GUICtrlOnHover.au3.

* Changed the main function name to _GUICtrl_OnHoverRegister, For backwards compatibility reasons, other (old) function names are still supported:

----_GUICtrl_SetOnHover, GUICtrl_SetOnHover, GUICtrlSetOnHover, _GUICtrlSetOnHover

* Fixed(?) issue when the UDF is not working under 64-bit OS.

* Global variables and internal functions renaming (for "cosmetic" reasons only).

* UDF's code is more readable now.

See first post.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  Quote

As before, available only version 1.8

Are you sure? what are you trying to download? please check this link, it's the attached html with redirection.

P.S

Perhaps the files is downloaded from browser's cache?

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

Replace

$p__GUICtrl_SOH_TimerProc = DllCallbackRegister("__GUICtrl_SOH_CALLBACK", "none", "hwnd;uint;uint_ptr;dword")

instead

$p__GUICtrl_SOH_TimerProc = DllCallbackRegister("__GUICtrl_SOH_CALLBACK", "none", "hwnd;int;int;dword")
Posted
  Quote

Replace

It's tested? the UDF will work under x64 after this change?

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  On 5/23/2010 at 7:52 PM, 'MrCreatoR said:

It's tested? the UDF will work under x64 after this change?

sorry. still not working with Yashied's change.
Posted (edited)

  On 5/23/2010 at 8:32 PM, 'Yashied said:

I do not have x64, but it's the only thing left wrong.

hey i am form the german autoi Forum ans a think this is a nice UDF and i can use this allot but it still dont work. The hole examples dont work :-(

I also have a x64 system.

Edited by Darter
Posted (edited)

  On 5/26/2010 at 8:31 AM, 'Darter said:

hey i am form the german autoi Forum ans a think this is a nice UDF and i can use this allot but it still dont work. The hole examples dont work :-(

I have a x64 system and it dont work :-(

oh sorry i klickt the wrong button and no i find no button to delete this post xD

Edited by Darter
Posted

nobody here how have a answer, because i think this funktion is very nice and i wanna use it but the funktion dont work :-(

Posted (edited)

ok finally figured it out.

WindowFromPoint actually expects a 64-bit POINT structure to be passed by value. see bug 1362 for more details.

replace __GUICtrl_SOH_ControlGetHovered() with the following rewrite and everything works as expected! :mellow:

Func __GUICtrl_SOH_ControlGetHovered()
    Local $iOld_Opt_MCM = Opt("MouseCoordMode", 1)

    Local $tPoint = DllStructCreate("int X;int Y")

    DllStructSetData($tPoint, "x", MouseGetPos(0))
    DllStructSetData($tPoint, "y", MouseGetPos(1))

    Local $tPointCast = DllStructCreate("int64", DllStructGetPtr($tPoint))

    Local $aRet = DllCall($s__GUICtrl_SOH_User32_Dll, "hwnd", "WindowFromPoint", "int64", DllStructGetData($tPointCast, 1))
    If @error Then Return SetError(@error, @extended, 0)

    Opt("MouseCoordMode", $iOld_Opt_MCM)

    Return $aRet[0]
EndFunc

ps: this works regardless of Yashied's suggested changes to SetTimer and KillTimer and $p__GUICtrl_SOH_TimerProc = DllCallbackRegister("__GUICtrl_SOH_CALLBACK", "none", "hwnd;uint;uint_ptr;dword")

cheers!

Homes32

Edited by Homes32
Posted

_WinAPI_WindowFromPoint is now an included function that contains the fix you describe. You could just change the custom function to use the included WindowFromPoint function.

Posted

Thanks!

Update available now:

  Quote

[v2.0] - [09.06.2010]

* Fixed potential issue with calling $sPrimaryDownFunc function (first call was performed only after recieving WM_COMMAND message, wich is the control event).

* Fixed an issue with blocking the OnHover function - the OnLeaveHover function was not called untill the OnHover function was blocked.

* Fixed(?) (again) an issue when the UDF is not working under 64-bit OS.

* Optimized internal "__GUICtrl_SOH_Call" function to work faster when calling parameters functions.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

  On 6/9/2010 at 6:45 PM, 'MrCreatoR said:

Thanks!

Update available now:

glad to help.

new version 2.0 is working fine in both 32 and 64 bit environments! :mellow:

Edited by Homes32
  • 2 weeks later...
Posted (edited)

  On 6/11/2010 at 3:34 PM, 'Homes32 said:

glad to help.

new version 2.0 is working fine in both 32 and 64 bit environments! :mellow:

If i use the obfuscator, the hovering of icons won't work

any fix for this?

/edit

found solution

after looking at the obfuscated script i saw that the functions in _GUICtrl_OnHoverRegister( didn'g got renamed

You have to ignore all user hover functions

e.g

_GUICtrl_OnHoverRegister(-1, "_Hover_button_run", "_Leave_Hover_button_run")

add: #Obfuscator_Ignore_Funcs=_Hover_button_run,_Leave_Hover_button_run

Edited by PiroX
  • 4 weeks later...
Posted

i use the button in Tab Item and when i moved on the button or click it fast

the button is flashing

how i can stop this flash

#include <GUIConstantsEx.au3>
#include <GuiTab.au3>
#include "UDFs\Icons.au3"
#include "UDFs\GUICtrlSetOnHover.au3"

Global $Hold = False
Global $Tab1_Background, $Tab1_Button1, $Tab1_Button2, $Tab1_Button3, $tab1

$GUI = GUICreate("Form1", 800, 600, -1, -1)
GUICtrlCreatePic(@ScriptDir & "\images\background_1.bmp", 0, 0, 800, 600, $WS_CLIPSIBLINGS)
GUICtrlSetState(-1, $GUI_DISABLE)

$MainTab = GUICtrlCreateTab(10, 200, 780, 390, $TCS_MULTILINE)
GUICtrlSetState(-1, $GUI_ONTOP)
GUISetFont(14, 700)

$tab1 = GUICtrlCreateTabItem("tab1")
$Tab1_Background = GUICtrlCreatePic(@ScriptDir & "\images\background_1.bmp", 10, 220, 780, 370)
GUICtrlSetState(-1, $GUI_DISABLE)
$Tab1_Button1 = GUICtrlCreatePic("", 380, 280, 90, 22)
GUICtrlSetOnHover(-1, '_HoverButton', '_LeaveButton', '_DownButton', '_HoverButton')
_LeaveButton($Tab1_Button1)
GUICtrlCreateTabItem("") ; end tabitem definition
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func _DownButton($CtrlID)
    If $Hold Then
        Return
    Else
        $Hold = True
    EndIf
    Local $File

    _SetImage($CtrlID, @ScriptDir & '\Images\Button1_down.png' & $File, $Tab1_Background)
EndFunc   ;==>_DownButton
Func _LeaveButton($CtrlID)
    Local $File
    _SetImage($CtrlID, @ScriptDir & '\Images\Button1_over.png' & $File, $Tab1_Background)
    $Hold = False
EndFunc   ;==>_LeaveButton
Func _HoverButton($CtrlID)
    Local $File
    _SetImage($CtrlID, @ScriptDir & '\Images\Button1_normal.png' & $File, $Tab1_Background)
    $Hold = False
EndFunc   ;==>_HoverButton

all files i used here

  • 2 months later...
Posted

Thanks for the update. I missed this function.

Note that for me if I do not put in the "$sLeaveHover_Func" part then this only works once. The next time my mouse hovers over the control nothing happens. If however, I state both the enter and leave functions then it works fine whenever my mouse hovers over it.

Thanks for the update, its working fine for me now that I'm calling it with parameters for both enter and leave.

Don't know if it matters but I'm using Win7 64bit.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...