Jump to content



Photo

GUICtrlSetOnHover UDF!


  • Please log in to reply
132 replies to this topic

#1 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 14 October 2007 - 06:08 AM

Ok, here is what i came up with after 3-4 hours of scripting well ok, it has been long time since then, so... after an year or so of hard scripting/testing!!!
(inspired by this topic)...

GUICtrlSetOnHover UDF...

Syntax:
_GUICtrl_OnHoverRegister(ControlID [, OnHoverFunc [, OnLeaveHoverFunc [, PrimaryDownFunc [, PrimaryUpFunc [, KeepCall_PrDn_Func [, KeepCall_Hover_Func]]]]]])

ControlID can be -1 as in Build-In functions!


Example:

AutoIt         
#include "GUICtrlOnHover.au3" Opt("GUIOnEventMode", 1) $Btn_Color = 0x7A9DD8 $Hover_Color = 0xFF0000 ;0x7AC5D8 $GUIMain = GUICreate("Letters Hovering Example", 570, 200) GUISetOnEvent(-3, "Quit") _CreateLetters_Proc(10, 60, 18, 20) GUICtrlCreateButton("Close", 30, 120, 100, 30) GUICtrlSetOnEvent(-1, "Quit") GUICtrlSetFont(GUICtrlCreateLabel("Letter: ", 35, 170, 200, 20), 9, 800) $Status_Label = GUICtrlCreateLabel("", 80, 171, 200, 20) GUICtrlSetColor(-1, 0xFF0000) GUICtrlSetFont(-1, 8.5, 800) GUISetState() While 1 Sleep(100) WEnd Func _CreateLetters_Proc($iLeft, $Top, $Width=15, $Height=15)     Local $iLeft_Begin = $iLeft     Local $iAsc_Char = 64     For $i = 0 To 25         $iLeft_Begin += 20         $iAsc_Char += 1         GUICtrlCreateButton(Chr($iAsc_Char), $iLeft_Begin, $Top, $Width, $Height)         _GUICtrl_OnHoverRegister(-1, "_Hover_Func", "_Leave_Hover_Func")         GUICtrlSetOnEvent(-1, "_Letter_Events")         GUICtrlSetBkColor(-1, $Btn_Color)         GUICtrlSetFont(-1, 6)     Next EndFunc Func _Letter_Events()     MsgBox(64, "Pressed", "Letter = " & GUICtrlRead(@GUI_CtrlId)) EndFunc Func _Hover_Func($iCtrlID)     GUICtrlSetBkColor($iCtrlID, $Hover_Color)     GUICtrlSetData($Status_Label, GUICtrlRead($iCtrlID))     Beep(1000, 20) EndFunc Func _Leave_Hover_Func($iCtrlID)     GUICtrlSetBkColor($iCtrlID, $Btn_Color)     GUICtrlSetData($Status_Label, "") EndFunc Func Quit() Exit EndFunc


Attachments:
[The archive include few nice examples, and the UDF itself of course :).]

* New (v2.1) (Redirection to Zip-file, 159 kb) Attached File  _GUICtrlSetOnHover.html   472bytes   4220 downloads

Attached File  GUICtrlSetOnHover.zip   49.12K   995 downloads
Attached File  GUICtrlSetOnHover_UDF.au3   20.06K   606 downloads
Attached File  GuiCtrlSetOnHover.zip   6.78K   1118 downloads
Attached File  GUICtrlSetOnHover_UDF_For_3.2.10.0.au3   3.71K   772 downloads
Old Beta - Attached File  GUICtrlSetOnHover_UDF_beta.zip   44.94K   519 downloads

Enjoy! Posted Image

P.S
Thanks to piccaso for the greatest CallBack tool! Without it, this UDF would never been created!

============================================

History version:

Spoiler

Edited by MrCreatoR, 04 July 2012 - 11:41 AM.

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team






#2 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,729 posts

Posted 14 October 2007 - 07:18 AM

Excellent Job, this is a lot like I had in mind... but using Picasso's Callback.au3 was a nice touch!

Edit:
I can see this:
$HOVER_CONTROLS_ARRAY[$Ubound][0] = GUICtrlGetHandle($CtrlID)

Maybe causing issues with Multiple GUI's?

Edit2:
And this will definately collide with anything I write:
Opt("OnExitFunc", "CallBack_Exit")

Edited by SmOke_N, 14 October 2007 - 07:27 AM.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.


#3 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 14 October 2007 - 08:16 AM

NVM!



http://www.autoitscript.com/forum/index.ph...st&p=418345



GOT IT!!! ...Fixed with _ControlHover()

http://www.autoitscript.com/forum/index.ph...st&p=418480

8)

Edited by Valuater, 16 October 2007 - 07:39 PM.

Posted Image

Clic The Pic!!!


#4 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 14 October 2007 - 09:03 AM

Thanks SmOke_N!

I can see this:
$HOVER_CONTROLS_ARRAY[$Ubound][0] = GUICtrlGetHandle($CtrlID)

Maybe causing issues with Multiple GUI's?

Yes it can, i thouth about it to, i think adding GUISwitch(WinGetHandle("")) and ControlGetHandel("", "", $CursorInfo[4]) can fix the problem... but then only forground window will handle the hovering...
I realy can't see perfect solution for this one... but if we use properly the child windows...

AutoIt         
#include <GUICtrlSetOnHover_UDF.au3> $Gui = GuiCreate("GUICtrlSetOnHover DEMO (With Child GUI)", 280, 200) $Button = GUICtrlCreateButton("Show Child", 20, 160) GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func") GUISetState() While 1     $Msg = GUIGetMsg()     Switch $Msg         Case -3             Exit         Case $Button             GUISetState(@SW_DISABLE, $Gui)             $Child_Gui = GUICreate("Child", 150, 100, -1, -1, -1, -1, $Gui)             $Child_Button = GUICtrlCreateButton("Child Button", 20, 20)             GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func")                         GUISetState(@SW_SHOW, $Child_Gui)                         While GUIGetMsg() <> -3             WEnd                         GUISetState(@SW_ENABLE, $Gui)             GUIDelete($Child_Gui)             GUISwitch($Gui)     EndSwitch WEnd Func Hover_Func($CtrlID)     Switch $CtrlID         Case $Button, $Child_Button             If GUICtrlRead($CtrlID) <> "New Button" Then GUICtrlSetData($CtrlID, "New Button")     EndSwitch EndFunc Func Leave_Hover_Func($CtrlID)     Switch $CtrlID         Case $Button, $Child_Button             If GUICtrlRead($CtrlID) <> "Button" Then GUICtrlSetData($CtrlID, "Button")     EndSwitch EndFunc

Everything will be OK ;) - But again, it's not perfect, sometimes we need to handle child window on the same "level" as the parent window...

And this will definately collide with anything I write

I do not know any way to do this without involve the host script :) - but maybe realy not needed to stop the timer after the script is exit, i think it will stop by itself, since (as far as i know) all the handles are closed before script exits.. maby here is the same? what you think?
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#5 Achilles

Achilles

    Achilles == Ichigo

  • Active Members
  • PipPipPipPipPipPip
  • 2,897 posts

Posted 14 October 2007 - 07:49 PM

Great work!!!

Now if I only had time to update all my scripts to use this instead of a mouse check...

#6 Nahuel

Nahuel

    To Err is human, to Arr is pirate.

  • Active Members
  • PipPipPipPipPipPip
  • 1,841 posts

Posted 15 October 2007 - 03:06 AM

Awesome job!

#7 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 9,692 posts

Posted 15 October 2007 - 03:46 AM

Nice. It should be included in the AutoIt installation in my opinion.

#8 Pascal257

Pascal257

    Prodigy

  • Active Members
  • PipPipPip
  • 158 posts

Posted 15 October 2007 - 12:46 PM

I actually haven't test this, but if this is working its soo awesome.
I'll definitely use it!

After some bugfixing and errorchecking this UDF should be included into the AutoIt-Package!

greetings,
Pascal

#9 Toady

Toady

    Easy there turbo...

  • Active Members
  • PipPipPipPipPipPip
  • 698 posts

Posted 15 October 2007 - 01:25 PM

very useful, thank you.
www.itoady.com (Go here to download the MacroGamer installer)

#10 Synapse

Synapse

    Adventurer

  • Active Members
  • PipPip
  • 107 posts

Posted 15 October 2007 - 02:41 PM

Hi...i think there is a problem if it`s over an image...the leave hover dosn`t work :)


Example:

$Pic1 = GUICtrlCreatePic("pic.jpg", 95, 0, 285, 75) $Label = GUICtrlCreateLabel("Label", 186, 48, 13, 17) GUICtrlSetOnHover($Yes, "Hover_Func", "Leave_Hover_Func")



Correct me if i`m wrong... ;)


BTW it`s awsome:D

#11 MikeOsdx

MikeOsdx

    Never trust a Monkey

  • Active Members
  • PipPipPipPipPipPip
  • 543 posts

Posted 15 October 2007 - 03:06 PM

Problem going from one control to another

If you have multiple controls next to eachother that have the OnHover UDF it seems to have problems with the Leave_Hover_Func.

Here is an example. If you move onto a button, then move off, everything is fine.
If you move your mouse across all the buttons, the Leave_Hover_Func appears to have a problem.

The $Hover stuff is to prevent flicker, but I commented it out for this example.

Plain Text         
#include <GuiConstants.au3> #include "GuiCtrlSetOnHover_UDF.au3" Opt ("guioneventmode", 1) $btn_color = 0x7A9DD8 $over_color = 0x7AC5D8 ;$Hover = 0 $GUIMain = GuiCreate("", 500, 200,(@DesktopWidth-500)/2, (@DesktopHeight-200)/2) Dim $pbAlphaBtn[26] Dim $hPriceBook[31]     $pbX = 10     $pbAsc = 64     for $i = 0 to UBound($pbAlphaBtn) - 1         $pbAsc += 1         $pbX += 15         $hPriceBook[$i + 1] = GUICtrlCreateButton(Chr($pbAsc), $pbX, 75, 13, 17)         GUICtrlSetOnHover(-1, "Hover_Func", "Leave_Hover_Func")         GUICtrlSetBkColor(-1, $btn_color)         GUICtrlSetFont(-1, 6)     Next $Close = GuiCtrlCreateButton("Close", 100, 120, 100, 30) GUICtrlSetOnEvent($Close, "_End") GuiSetState() While 1     Sleep(10) WEnd Func Hover_Func($CtrlID) ;   if $Hover = 0 Then         GUICtrlSetBkColor($CtrlID, $over_color) ;       $Hover = 1 ;   EndIf EndFunc Func Leave_Hover_Func($CtrlID)     GUICtrlSetBkColor($CtrlID, $btn_color) ;   $Hover = 0 EndFunc Func _End()     Exit EndFunc

Posted Image

#12 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 15 October 2007 - 07:21 PM

Problem going from one control to another

I have notice the problems to, but while i fixing the problem with «on hover leave», the flicking problem still a mistory for me... if i use a mark inside UDF, then the issue with the "flicking" is fixed, but then there is the issue with the leave hovering ;)...

I will try (i already spent hours on trying :) ) to find suitable solution...

Thanks to all.
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#13 Valuater

Valuater

    www.PayFreeWireless.com

  • MVPs
  • 11,078 posts

Posted 15 October 2007 - 08:12 PM

Working code with _ControlHover()


AutoIt         
#include <GuiConstants.au3> #include<_ControlHover.au3> Opt ("guioneventmode", 1) $btn_color = 0x7A9DD8 $over_color = 0x7AC5D8 $CtrlTemp = "" $GUIMain = GuiCreate("", 500, 200,(@DesktopWidth-500)/2, (@DesktopHeight-200)/2) GUISetOnEvent( -3, "_End") $List = GUICtrlCreateCombo("", 60, 15, 100, 20) GUICtrlSetData( -1, "This|That|The other|This way|That way|Which Way|") Dim $pbAlphaBtn[26] Dim $hPriceBook[31]     $pbX = 10     $pbAsc = 64     for $i = 1 to UBound($pbAlphaBtn) - 1         $pbAsc += 1         $pbX += 15         $hPriceBook[$i] = GUICtrlCreateButton(Chr($pbAsc), $pbX, 75, 13, 17)         _ControlHover(2, "", $hPriceBook[$i]) ; add controls here         GUICtrlSetOnEvent( -1, "_Function")         GUICtrlSetBkColor(-1, $btn_color)         GUICtrlSetFont(-1, 6)     Next $Close = GuiCtrlCreateButton("Close", 100, 120, 100, 30) GUICtrlSetOnEvent($Close, "_End") GuiSetState() While 1     Sleep(5)     $Over = _ControlHover(0, $GUIMain)     If $Over = 1 Then         $tempID = @extended         For $x = 1 to ubound($hPriceBook) -1         If $tempID = $hPriceBook[$x] Then             Hover_Func($hPriceBook[$x])             ExitLoop         EndIf         Next     EndIf WEnd Func Hover_Func($CtrlID)     If $CtrlID = $CtrlTemp Then Return     GUICtrlSetBkColor($CtrlTemp, $btn_color)     GUICtrlSetBkColor($CtrlID, $over_color)     $CtrlTemp = $CtrlID EndFunc Func _End()     Exit EndFunc Func _Function()     MsgBox(0x0, "Pressed", GUICtrlRead(@GUI_CtrlId), 3) EndFunc


8)

Edited by Valuater, 16 October 2007 - 07:40 PM.

Posted Image

Clic The Pic!!!


#14 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 20 November 2007 - 10:43 AM

I did it!!!!!!!!! ;)

Finaly! :) :P

+ Now when two (or more) controls are closely one to eachother, then On_Leave_Hover function is called correctly!
+ Now if the control is placed inside the Tab control, then also when leaving hovering, the function called as it should.
+ Now the hovering process work even if the GUI window is not active!!! :P Thanks to amel27 for that, he wrote the function _ControlGetHovered(), that i used to indicate the currently hovered control id.
+ No need for "Mark variables" anymore!

First post Updated!!! - Now all examples and the UDF is stored in archive file. The example in the first post is the best presentation of this UDF!
Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#15 JRSmile

JRSmile

    IT infrastructure specialist

  • Active Members
  • PipPipPipPipPipPip
  • 453 posts

Posted 20 November 2007 - 01:43 PM

Absolutely VERY NICE!!! 12Points :P
$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));)''Chr("a")&"HI"Next;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)Try2Hack: http://www.try2hack.nl/levels/level13-olwehfdow.xhtml

#16 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 20 November 2007 - 09:08 PM

Absolutely VERY NICE

Thanks!

12Points

There is "Rating Option" at the top of the first post :P

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

Posted Image AutoIt Russian CommunityPosted Image Projects: ATT - Application Translate Tool [new] | BlockIt - Block files & folders [new] | SIP - Selected Image Preview [new] | SISCABMAN - SciTE Abbreviations Manager [new] | AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramPosted Image UDFs: OnAutoItErrorRegister - Handle AutoIt critical errors [new] | AutoIt Syntax Highlight [new] | Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDFPosted Image Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation DemoLike the examples/UDFs? Please rate the topic (up-right corner of the post header: Rating Posted Image)* === My topics === *

==========================================================Posted Image==========================================================

AutoIt is simple, subtle, elegant. © AutoIt Team


#17 JRSmile

JRSmile

    IT infrastructure specialist

  • Active Members
  • PipPipPipPipPipPip
  • 453 posts

Posted 20 November 2007 - 09:38 PM

There is "Rating Option" at the top of the first post.

did so, nice remark...
$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])));)''Chr("a")&"HI"Next;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)Try2Hack: http://www.try2hack.nl/levels/level13-olwehfdow.xhtml

#18 Achilles

Achilles

    Achilles == Ichigo

  • Active Members
  • PipPipPipPipPipPip
  • 2,897 posts

Posted 21 November 2007 - 01:37 AM

Great work! I wish I had time to update all my projects to use this!

#19 Jex

Jex

    Polymath

  • Active Members
  • PipPipPipPip
  • 206 posts

Posted 21 November 2007 - 08:05 AM

Very usefull UDF and working perfect.
Great job ;)

Edit : If im use "Opt("MouseCoordMode", 0)" script not work true :P

Edited by Jex, 21 November 2007 - 12:30 PM.


#20 ValeryVal

ValeryVal

    Dig the way

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 21 November 2007 - 02:09 PM

;(soon i will adapt it to the latest beta's CallBack functions).

This file GUICtrlSetOnHover_UDF.au3:
Plain Text         
#include-once Opt("MustDeclareVars", 1) Opt("OnExitFunc", "CallBack_Exit") ;Thanks to piccaso for the CallBack funcs!!! ;(soon i will adapt it to the latest beta's CallBack functions). ; Adjustable values Global Const $gi_DllCallBack_uiMsg = 0x7FFF; WM_USER + 0x7BFF Global Const $gi_DllCallBack_MaxStubs = 64 ; Constants for $nOptions Global Const $_DllCallBack_StdCall = 0 Global Const $_DllCallBack_Cdecl = 1 Global Const $_DllCallBack_Sync = 2 Global Const $_DllCallBack_Subclass = 4 Global Const $_DllCallBack_Struct = 8 Global Const $_DllCallBack_Debug = 1024 ; Internaly used Global Const $gs_DllCallBack_typedef_CriticalSection = "PTR DebugInfo;LONG LockCount;LONG RecursionCount;PTR OwningThread;PTR LockSemaphore;DWORD SpinCount" Global $gp_DllCallBack_SendMessage = 0 Global $gh_DllCallBack_hUser32 = 0 Global $gi_DllCallBack_StubCount = 0 Global $gp_DllCallBack_EnterCriticalSection = 0 Global $gp_DllCallBack_LeaveCriticalSection = 0 Global $gp_DllCallBack_CallWindowProc = 0 Global $gh_DllCallBack_hWnd = GUICreate("au3_Callback") Global $gf_DllCallBack_fMsgRegistred = GUIRegisterMsg($gi_DllCallBack_uiMsg, "__DllCallBack_MsgHandler") Global $ga_DllCallBack_sParameters[$gi_DllCallBack_MaxStubs + 1] Global $ga_DllCallBack_nParameters[$gi_DllCallBack_MaxStubs + 1] Global $ga_DllCallBack_sFunctions[$gi_DllCallBack_MaxStubs + 1] Global $ga_DllCallBack_hGlobals[$gi_DllCallBack_MaxStubs + 1] Global $ga_DllCallBack_vCriticalSections[$gi_DllCallBack_MaxStubs + 1] Global $ga_DllCallBack_nOptions[$gi_DllCallBack_MaxStubs + 1] ;GUICtrlSetOnHover Initialize Global $HOVER_CONTROLS_ARRAY[1][1] Global $LAST_HOVERED_ELEMENT[2] = [-1, -1] Global $LAST_HOVERED_ELEMENT_MARK = -1 Global $pTimerProc = DllCallbackRegister("CALLBACKPROC", "none", "hwnd;uint;uint;dword") Global $uiTimer = DllCall("user32.dll", "uint", "SetTimer", "hwnd", 0, "uint", 0, "int", 10, "ptr", DllCallbackGetPtr($pTimerProc)) $uiTimer = $uiTimer[0] Opt("MustDeclareVars", 0) Func CALLBACKPROC($hWnd, $uiMsg, $idEvent, $dwTime)     If UBound($HOVER_CONTROLS_ARRAY)-1 < 1 Then Return     Local $ControlGetHovered = _ControlGetHovered()     Local $sCheck_LHE = $LAST_HOVERED_ELEMENT[1]         If $ControlGetHovered = 0 Or ($sCheck_LHE <> -1 And $ControlGetHovered <> $sCheck_LHE) Then         If $LAST_HOVERED_ELEMENT_MARK = -1 Then Return         If $LAST_HOVERED_ELEMENT[0] <> -1 Then Call($LAST_HOVERED_ELEMENT[0], $LAST_HOVERED_ELEMENT[1])         $LAST_HOVERED_ELEMENT[0] = -1         $LAST_HOVERED_ELEMENT[1] = -1         $LAST_HOVERED_ELEMENT_MARK = -1     Else         For $i = 1 To $HOVER_CONTROLS_ARRAY[0][0]             If $HOVER_CONTROLS_ARRAY[$i][0] = GUICtrlGetHandle($ControlGetHovered) Then                 If $LAST_HOVERED_ELEMENT_MARK = $HOVER_CONTROLS_ARRAY[$i][0] Then ExitLoop                 $LAST_HOVERED_ELEMENT_MARK = $HOVER_CONTROLS_ARRAY[$i][0]                 Call($HOVER_CONTROLS_ARRAY[$i][1], $ControlGetHovered)                 If $HOVER_CONTROLS_ARRAY[$i][2] <> -1 Then                     $LAST_HOVERED_ELEMENT[0] = $HOVER_CONTROLS_ARRAY[$i][2]                     $LAST_HOVERED_ELEMENT[1] = $ControlGetHovered                 EndIf                 ExitLoop             EndIf         Next     EndIf EndFunc Func GUICtrlSetOnHover($CtrlID, $HoverFuncName, $LeaveHoverFuncName=-1)     Local $Ubound = UBound($HOVER_CONTROLS_ARRAY)     ReDim $HOVER_CONTROLS_ARRAY[$Ubound+1][3]     $HOVER_CONTROLS_ARRAY[$Ubound][0] = GUICtrlGetHandle($CtrlID)     $HOVER_CONTROLS_ARRAY[$Ubound][1] = $HoverFuncName     $HOVER_CONTROLS_ARRAY[$Ubound][2] = $LeaveHoverFuncName     $HOVER_CONTROLS_ARRAY[0][0] = $Ubound EndFunc ;Thanks to amel27 for that one!!! Func _ControlGetHovered()     Local $iRet = DllCall("user32.dll", "int", "WindowFromPoint", _         "long", MouseGetPos(0), _         "long", MouseGetPos(1))     $iRet = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $iRet[0])     Return $iRet[0] EndFunc ; Internals Func __DllCallBack_MsgHandler($hWnd_Callback, $uiMsg, $wParam, $lParam)     Local $vParameters, $i     If $ga_DllCallBack_nParameters[$wParam] > 0 Then         $vParameters = DllStructCreate($ga_DllCallBack_sParameters[$wParam], $lParam)         If BitAND($ga_DllCallBack_nOptions[$wParam], $_DllCallBack_Struct) Then             Local $aCallArgs[2] = ["CallArgArray", $vParameters]         Else             Local $aCallArgs[$ga_DllCallBack_nParameters[$wParam] + 1]             $aCallArgs[0] = "CallArgArray"             For $i = 1 To $ga_DllCallBack_nParameters[$wParam]                 $aCallArgs[$i] = DllStructGetData($vParameters, $i)             Next         EndIf         Return Call($ga_DllCallBack_sFunctions[$wParam], $aCallArgs)     EndIf     Return Call($ga_DllCallBack_sFunctions[$wParam]) EndFunc  ;==>__DllCallBack_MsgHandler Func CallBack_Exit()     DllCallbackFree($pTimerProc)     DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "uint", $uiTimer) EndFunc

works with AutoIt3 v3.2.9.13 (beta) and after as I hope.
The point of world view




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users