Popular Post MrCreatoR Posted October 14, 2007 Popular Post Share Posted October 14, 2007 (edited) 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: expandcollapse popup#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) _GUICtrlSetOnHover.html GUICtrlSetOnHover.zip GUICtrlSetOnHover_UDF.au3 GuiCtrlSetOnHover.zip GUICtrlSetOnHover_UDF_For_3.2.10.0.au3 Old Beta - GUICtrlSetOnHover_UDF_beta.zip Enjoy! P.S Thanks to piccaso for the greatest CallBack tool! Without it, this UDF would never been created! ============================================ History version: [v2.1] - [04.07.2012] * Compatibility with ColorPicker.au3 UDF. * Fixed issue with releasing resources (last unregistered control was still active for hovering). + Added function to release all resources: _GUICtrl_OnHoverReleaseResources + Added alternative UDF "GUICtrlOnHover_NoCallback.au3", it uses AdlibRegister instead of callback with timer. In some cases callback can cause a memory leak. The disadvantage is obvious, any blocking function or loop will "freeze" the hovering events. [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. [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. [v1.8] - [28.09.2009] * Few Global variables now have more unique name. * Fixed an issue with false calling of function on PrimaryDown event. 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. * Due to (and as a result of) previous issue, the UDF now registering WM_COMMAND and WM_LBUTTONDOWN messages at first UDF call. [v1.7] - [07.07.2009] + Added _GUICtrl_SetHoverOnBackwindow... ----Allows to set the hovering mode: ----------$iSetBackWin = 1 (default) hovering process will proceed even when GUI is not active (in background). ----------$iSetBackWin <> 1 hovering process will NOT proceed when GUI is not active. [v1.6] - [12.06.2009] * Now the UDF compatible with scripts (or other udfs) that uses OnAutoItExit function. ------i.e: "OnAutoItExit" function that was *previously* set by user will be called as well. + Added new parameter $iKeepCall_Hover_Func. If this parameter = 1, ------then the $sHover_Func function *Will* be called constantly untill the control is no longer been hovered ------(default is 0, do not call the function constantly). + Added new arguments to calling function... ------The OnPrimaryDown/Up function now can recieve one more argument: ------------------------$iClickMode - Defines the Click mode (1 - Pressed, 2 - Released) * Changed return value - function will return 2 when $iCtrlID is redefined (ReSet, already exists in the controls list). * Fixed incorrect documentation parts. * Fixed "onclick" handeling. When using multiple GUIs, the active gui was not recognized properly. * Fixed(?) bug with "dimension range exceeded" when trying to UnSet a Control. [v1.5] + Added AutoIt 3.2.10.0+ support, but 3.2.8.1 or less is dropped (due to lack of native CallBack functions). + Added Primary Down and Primary Up support. Helping to handle with the buttons pressing. + Added new arguments to calling function... ------The OnHover function now can recieve two more arguments: ------------------$iHoverMode - Defines the hover mode (1 - Hover, 2 - Leaves Hovering) ------------------$hWnd_Hovered - Control Handle where the mouse is moved to (after hovering). * Almost all code of this UDF was rewritted. * Now the main function name is _GUICtrl_SetOnHover(), ------but for backwards compatibility reasons, other (old) function names are still supported. * Fixed bug with hovering controls in other apps. * Improvements in generaly, the UDF working more stable now. [v1.?] * Beta changes, see this thread's previous posts for more details. [v1.0] * First release. Edited July 4, 2012 by MrCreatoR Leo1906, PlayHD, minxomat and 6 others 8 1 Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler 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 ProgramUDFs: 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 UDF 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 Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 14, 2007 Moderators Share Posted October 14, 2007 (edited) 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 October 14, 2007 by SmOke_N 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. Link to comment Share on other sites More sharing options...
Valuater Posted October 14, 2007 Share Posted October 14, 2007 (edited) NVM!EndFunchttp://www.autoitscript.com/forum/index.ph...st&p=418345GOT IT!!! ...Fixed with _ControlHover()http://www.autoitscript.com/forum/index.ph...st&p=4184808) Edited October 16, 2007 by Valuater Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 14, 2007 Author Share Posted October 14, 2007 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... expandcollapse popup#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 writeI 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? Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler 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 ProgramUDFs: 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 UDF 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 Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Achilles Posted October 14, 2007 Share Posted October 14, 2007 Great work!!! Now if I only had time to update all my scripts to use this instead of a mouse check... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Nahuel Posted October 15, 2007 Share Posted October 15, 2007 Awesome job! Link to comment Share on other sites More sharing options...
Richard Robertson Posted October 15, 2007 Share Posted October 15, 2007 Nice. It should be included in the AutoIt installation in my opinion. Link to comment Share on other sites More sharing options...
Pascal257 Posted October 15, 2007 Share Posted October 15, 2007 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 Link to comment Share on other sites More sharing options...
Toady Posted October 15, 2007 Share Posted October 15, 2007 very useful, thank you. www.itoady.com A* (A-star) Searching Algorithm - A.I. Artificial Intelligence bot path finding Link to comment Share on other sites More sharing options...
Synapse Posted October 15, 2007 Share Posted October 15, 2007 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 Link to comment Share on other sites More sharing options...
BigDaddyO Posted October 15, 2007 Share Posted October 15, 2007 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. expandcollapse popup#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 Link to comment Share on other sites More sharing options...
MrCreatoR Posted October 15, 2007 Author Share Posted October 15, 2007 Problem going from one control to anotherI 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. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler 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 ProgramUDFs: 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 UDF 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 Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Valuater Posted October 15, 2007 Share Posted October 15, 2007 (edited) Working code with _ControlHover() expandcollapse popup#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 October 16, 2007 by Valuater Link to comment Share on other sites More sharing options...
MrCreatoR Posted November 20, 2007 Author Share Posted November 20, 2007 I did it!!!!!!!!! Finaly! + 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!!! 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! Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler 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 ProgramUDFs: 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 UDF 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 Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
JRSmile Posted November 20, 2007 Share Posted November 20, 2007 Absolutely VERY NICE!!! 12Points $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:-) Link to comment Share on other sites More sharing options...
MrCreatoR Posted November 20, 2007 Author Share Posted November 20, 2007 Absolutely VERY NICEThanks!12PointsThere is "Rating Option" at the top of the first post Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler 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 ProgramUDFs: 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 UDF 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 Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
JRSmile Posted November 20, 2007 Share Posted November 20, 2007 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:-) Link to comment Share on other sites More sharing options...
Achilles Posted November 21, 2007 Share Posted November 21, 2007 Great work! I wish I had time to update all my projects to use this! My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Jex Posted November 21, 2007 Share Posted November 21, 2007 (edited) Very usefull UDF and working perfect. Great job Edit : If im use "Opt("MouseCoordMode", 0)" script not work true Edited November 21, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
ValeryVal Posted November 21, 2007 Share Posted November 21, 2007 ;(soon i will adapt it to the latest beta's CallBack functions). This file GUICtrlSetOnHover_UDF.au3: expandcollapse popup#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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now