fmen Posted March 7, 2007 Share Posted March 7, 2007 This is a simple script that allows me to automatically get focus of an edit frame in the application CPR. (Who ever coded CPR is an idiot but that's another story).Anyway, my little script works great. When the mouse is moved over the frame, the cursor changes into the Ibar shape and the frame becomes active and focused.Unfortunately, a side effect is that double clicking with the left mouse button becomes disabled, not just in CPR but in all other window programs, including desktop icons. Why does this happen? Is there a cure?Thanks in advance for any thoughts.AutoItSetOption ( "WinTitleMatchMode", 2 )$cursor=5 ;Ibar cursor shapeWhile 1 Sleep (50) If MouseGetCursor()=$cursor And WinActive ("CPR", "LOCAL TITLE") Then Call ("Ibar1") If MouseGetCursor()<>5 Then $cursor = 5 WEndFunc Ibar1() $cursor = not $cursor ControlFocus("CPRS", "", "TRichEdit1") EndFunc Link to comment Share on other sites More sharing options...
lod3n Posted March 7, 2007 Share Posted March 7, 2007 How about this. I could only test it with Scite, but it should work with your app too: AutoItSetOption ( "WinTitleMatchMode", -4 ) $wintitle = "CPR" $wintext = "LOCAL TITLE" $editctrl = "TRichEdit1" ;~ $wintitle = "classname=SciTEWindow" ;~ $wintext = "" ;~ $editctrl = "Scintilla1" While 1 Sleep (100) If MouseGetCursor()=5 then if WinActive ($wintitle, $wintext) Then $hEdit = ControlGetHandle($wintitle, $wintext, $editctrl) $hFocus = ControlGetHandle($wintitle, $wintext,ControlGetFocus($wintitle, $wintext)) if $hEdit <> $hFocus then ControlFocus($wintitle, $wintext, $editctrl) EndIf endif EndIf WEnd [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
fmen Posted March 7, 2007 Author Share Posted March 7, 2007 Thanks for the suggestion, lod3n. Unfortunately, double clicking is still disabled in all applications. (I haven't tried scite though) Link to comment Share on other sites More sharing options...
lod3n Posted March 8, 2007 Share Posted March 8, 2007 Hmm, even if you activate a different application? That's strange. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Skarn Posted April 6, 2008 Share Posted April 6, 2008 I also suffer this unusual bug. It seems after I have a vbscript call the MouseGetCursor function from an instance of autoit com object it makes the doubleclick misbehave system wide. Can no longer maximise windows, or double click icons. However some double clicks continue to work, for example I can double click a line of code in notepad++ and it selects as expected. Is there any solution or idea yet on how to fix this? Once the script exits the function returns to normal. Setting the object to nothing isn't sufficient to emulate an 'unloading' of the autoit object (as an idea I tried).... Any other ideas? Link to comment Share on other sites More sharing options...
Skarn Posted April 19, 2008 Share Posted April 19, 2008 Anyone? A solution? this is a crippling bug. Link to comment Share on other sites More sharing options...
martin Posted April 27, 2009 Share Posted April 27, 2009 Anyone? A solution? this is a crippling bug. I have the same problem, but I for me it only caused a problem when my script was not active. For example, I could not double click My Computer to open up explorer. I was able to solve my problem quite easily by having something like this If WinACtive($MyGui) then;only check if my script is active ;start loop where I want to check cursor $Cursortype = MouseGetCursor() EndIf Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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