Jump to content



Photo

MouseOnEvent UDF!


  • Please log in to reply
143 replies to this topic

#1 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 21 February 2008 - 08:18 AM

This UDF allows to set an events handler (a hook) for Mouse device.

The beginning...
I searched for a way to disable the Mouse Primary click, and be able to call some function when the click event is received...
Big thanks to amel27 for this one, i only organized the whole stuff to UDF style.

Example:
Spoiler



Available Events Constants:


$MOUSE_MOVE_EVENT - Mouse moving.
$MOUSE_PRIMARYDOWN_EVENT - Primary mouse button down.
$MOUSE_PRIMARYUP_EVENT - Primary mouse button up.
$MOUSE_PRIMARYDBLCLK_EVENT - Primary mouse button double click.
$MOUSE_SECONDARYDOWN_EVENT - Secondary mouse button down.
$MOUSE_SECONDARYUP_EVENT - Secondary mouse button up.
$MOUSE_SECONDARYDBLCLK_EVENT - Secondary mouse button double click.
$MOUSE_WHEELDOWN_EVENT - Wheel mouse button pressed down.
$MOUSE_WHEELUP_EVENT - Wheel mouse button up.
$MOUSE_WHEELDBLCLK_EVENT - Wheel mouse button double click.
$MOUSE_WHEELSCROLL_EVENT - Wheel mouse scroll.
$MOUSE_WHEELSCROLLDOWN_EVENT - Wheel mouse scroll Down.
$MOUSE_WHEELSCROLLUP_EVENT - Wheel mouse scroll Up.
$MOUSE_XBUTTONDOWN_EVENT - Side mouse button down (usually navigating next/back buttons).
$MOUSE_XBUTTONUP_EVENT - Side mouse button up.
$MOUSE_XBUTTONDBLCLK_EVENT - [Not implemented yet] Side mouse button double click.


------------------------------------------

CHANGELOG:

Spoiler



Download:
From Downloads: MouseOnEvent.zip
Attached: Attached File  MouseOnEvent.zip   9.93K   714 downloads

Old version:
Attached File  MouseSetOnEvent_UDF_1.8.zip   7.63K   2746 downloads
Attached File  MouseSetOnEvent_UDF_1.7.zip   7.08K   1269 downloads
Attached File  MouseSetOnEvent_UDF_1.6.zip   7.07K   328 downloads
Attached File  MouseSetOnEvent_UDF_1.5.zip   6.92K   358 downloads
Attached File  MouseSetOnEvent_UDF_1.4.zip   5.61K   421 downloads
Attached File  MouseSetOnEvent_UDF_1.3.zip   2.91K   1449 downloads
Previous downloads: 146 + 200 + 804

Edited by MrCreatoR, 30 August 2012 - 05:38 PM.

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 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 21 March 2008 - 07:16 PM

One mounth, 51 downloads (views?), and no comments? :)

:)
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


#3 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,727 posts

Posted 21 March 2008 - 08:02 PM

Hi,

seems to work quite fine! But I do not use OnEvent mode.

Mega
Scripts & functions Organize Includes Let Scite organize the include files *newYahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication)_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

#4 weaponx

weaponx

    I'm coming for blood, no code of conduct, no law.

  • MVPs
  • 5,366 posts

Posted 21 March 2008 - 08:09 PM

Maybe the problem is that the title says "_MoseSetOnEvent"

#5 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 21 March 2008 - 08:49 PM

seems to work quite fine!

Thanks.

But I do not use OnEvent mode.

The UDF has nothing to do with OnEvent mode :) - you can use it with any mode :)
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


#6 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,727 posts

Posted 21 March 2008 - 09:08 PM

Thanks.
The UDF has nothing to do with OnEvent mode :) - you can use it with any mode :)

:party: did just one short run and assumed the rest.

It is cool. This way, it is possible to add an option to BlockInput to just disable the mouse.

I tried this but it gets an error.

#include <MouseSetOnEvent_UDF.au3> _blockInput() ToolTip('MouseClicks is disabled') Sleep(5000) _blockInput(1) ToolTip('MouseClicks is enabled') Sleep(5000) Func _blockInput($opt = 0)     If $opt = 0 Then         _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_do")         _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "_do")     Else         _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT)         _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT)     EndIf EndFunc   ;==>_blockInput Func _do() EndFunc


Mega
Scripts & functions Organize Includes Let Scite organize the include files *newYahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication)_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

#7 monoceres

monoceres

    asdf

  • MVPs
  • 3,717 posts

Posted 21 March 2008 - 11:10 PM

This is really useful, will certainly add this to my autoit directory on my desktop :)
Posted ImageIs the link in my post broken? I do not longer own my domain, all the files are moved to my new domain.Example: http://monoceres.se/test.au3 -> http://andhen.mine.nu/monoceres.se/test.au3

#8 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 21 March 2008 - 11:32 PM

:) did just one short run and assumed the rest.

It is cool. This way, it is possible to add an option to BlockInput to just disable the mouse.

I tried this but it gets an error.

Oops :) , the error is because i did a mistake when the array is Redimmed... just find in the UDF this line:

ReDim $aTmp_Mouse_Events[$aTmp_Mouse_Events[0][0]+1][0]

and replace last [0] by [4]

And nice example btw, i will include it into the archive, but i changed it a little(?)...

AutoIt         
#include <MouseSetOnEvent_UDF.au3> _BlockMouseClicksInput(0) ToolTip('MouseClicks is disabled') Sleep(3000) _BlockMouseClicksInput(1) ToolTip('MouseClicks is enabled') Sleep(3000) Func _BlockMouseClicksInput($iOpt=0)     If $iOpt = 0 Then         _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT, "__Dummy")         _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "__Dummy")         _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "__Dummy")         _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "__Dummy")     Else         _MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT)         _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT)         _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT)         _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT)     EndIf EndFunc   ;==>_BlockMouseClicksInput

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


#9 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 21 March 2008 - 11:43 PM

Updated first post:

CHANGELOG:

v1.1 [22.03.2008]
* Fixed: Incorrect ReDim when remove event from the array, it was causing UDF to crash script with error.
* Spell/Grammar corrections :)
* Added: An example of _BlockMouseClicksInput().
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


#10 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,727 posts

Posted 22 March 2008 - 04:41 PM

Hi,

thanks for credit.
That is what I meant. (example)
Blocking the mouse is really helpful sometimes!

Great!

Mega
Scripts & functions Organize Includes Let Scite organize the include files *newYahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication)_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

#11 weaponx

weaponx

    I'm coming for blood, no code of conduct, no law.

  • MVPs
  • 5,366 posts

Posted 22 March 2008 - 06:46 PM

Maybe the problem is that the title says "_MoseSetOnEvent"


The title of the topic and and the first post have a misspelling.

#12 taz742

taz742

    Seeker

  • Active Members
  • 46 posts

Posted 31 March 2008 - 11:48 PM

Great work :)
I'm gonna start playing with !!
Posted Image

#13 Achilles

Achilles

    Achilles == Ichigo

  • Active Members
  • PipPipPipPipPipPip
  • 2,897 posts

Posted 01 April 2008 - 04:18 AM

This is useful... Thanks!

#14 topg

topg

    Seeker

  • New Members
  • 1 posts

Posted 02 April 2008 - 12:11 PM

Hi,

I tried to play around with the following script.
The intention is to demonstrate right mouse click in a specific application, say UltraEdit.
It is very simple, if you right mouse click (down/up) when UltraEdit is active, then a tooltip will be displayed.
If you right mouse click in another Window, it will perform normal right mouse click.
If middle mouse button is clicked, the application will exit.

I have two questions

1. what is the best way to make this program stay in memory to track mouse clicks until it is terminated?
sleep(2147483647) is a bad way I suppose, but for testing purpose, it is ok
another way is

while 1
wend

2. this is really annoying me
After this program exits, left mouse click is not able to activate other Window
Only after I press Alt+Tab to switch to other Window, left mouse click starts to work normally

Any inputs will be appreciated :)

Plain Text         
#include <MouseSetOnEvent_UDF.au3> _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT, "RightMouseUp") _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT, "RightMouseDown") _MouseSetOnEvent($MOUSE_WHELLUP_EVENT , "MiddleMouseUp") sleep(2147483647) Func RightMouseUp()   If WinActive("UltraEdit") Then     ToolTip("Right Mouse up")   Else     MouseUp("Right")   EndIf EndFunc Func RightMouseDown()   If WinActive("UltraEdit") Then     ToolTip("Right Mouse down")   Else     MouseDown("Right")   EndIf EndFunc Func MiddleMouseUp()   _MouseSetOnEvent($MOUSE_SECONDARYUP_EVENT);Enable mouse button back.   _MouseSetOnEvent($MOUSE_SECONDARYDOWN_EVENT);Enable mouse button back.   _MouseSetOnEvent($MOUSE_WHELLUP_EVENT);Enable mouse button back.   exit EndFunc


#15 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 05 April 2008 - 09:46 AM

First post updated:

v1.2 [05.04.2008]
* Added: [Optional] parameter $hTargetWnd, if set, the OnEvent function will be called only on $hTargetWnd window, otherwise will be standard Event processing.
Note: Can be a little(?) buggy when you mix different events :)
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


#16 MrCreatoR

MrCreatoR

    Must AutoIt!

  • MVPs
  • 3,241 posts

Posted 05 April 2008 - 09:48 AM

what is the best way to make this program stay in memory to track mouse clicks until it is terminated?
sleep(2147483647) is a bad way I suppose

You can just set a loop:

While 1    Sleep(10) WEnd


:)
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 NELyon

NELyon

    Do you wanna brew my avatar?

  • Active Members
  • PipPipPipPipPipPip
  • 3,526 posts

Posted 07 April 2008 - 10:05 PM

I know it's an older topic, but this is one of the few UDF's posted lately that I actually needed to use in a project of mine.

Awesome UDF :)

EDIT: I may have found a possible bug (Unless this is intended behavior)

Try this code in SciTe:
#include <MouseSetOnEvent_UDF.au3> _MouseSetOnEvent(516, "BlowUp") Sleep(5000) _MouseSetOnEvent(516) Func BlowUp()     MsgBox(0, "Kaboom", "You all die") EndFunc


Now press the right mouse button. You see the MsgBox. Now when you exit the MsgBox, the context menu appears as if you pressed the button twice. Is this intended?

Edited by KentonBomb, 07 April 2008 - 11:58 PM.


#18 MerkurAlex

MerkurAlex

    I live on cookies and AutoIt.

  • Active Members
  • PipPipPipPipPipPip
  • 639 posts

Posted 08 April 2008 - 04:10 AM

Great udf!

Larry is a mass murderer?! Posted ImageIt's always the quiet, clean cut, bald guys... Posted Image


#19 jennico

jennico

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 862 posts

Posted 05 May 2008 - 10:21 PM

damn, i really want to use your udf !!!

but am i the only one who has problems ? i have got the "MouseSetOnEvent_UDF.au3", i tried it with v 3.2.8.1 and 3.2.10.0 and the latest beta, but i do not have the following functions:

- DllCallbackRegister
- DllCallbackGetPtr
- DllCallbackFree

and so on. so please where can i find these ? i've been searching the forum for hours, but there seems to be a problem with lots of functions with similar names.

thx

j.
I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Posted ImageDon't forget this IP: 213.251.145.96

#20 NELyon

NELyon

    Do you wanna brew my avatar?

  • Active Members
  • PipPipPipPipPipPip
  • 3,526 posts

Posted 05 May 2008 - 10:46 PM

damn, i really want to use your udf !!!

but am i the only one who has problems ? i have got the "MouseSetOnEvent_UDF.au3", i tried it with v 3.2.8.1 and 3.2.10.0 and the latest beta, but i do not have the following functions:

- DllCallbackRegister
- DllCallbackGetPtr
- DllCallbackFree

and so on. so please where can i find these ? i've been searching the forum for hours, but there seems to be a problem with lots of functions with similar names.

thx

j.


It requires Beta.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users