mercadantelaura Posted January 23, 2014 Share Posted January 23, 2014 (edited) I have Windows7 x64 and i wrote my script that run my browser, and until it is active Mouse Wheel have direction inverted (i would use this function also for my VideoPlayer) but don't run. Using AutoHotKey is sufficent these 2 rows: WheelUp::WheelDown WheelDown::WheelUp Under AutoIT i have problems. I have proved under different programs as "Windows Explorer" - "PowerDVD" - "FireFox" but wheel is crazy when running my script. In addiction when i Run my program i want that its window is showed always with same user dimension in the same fixed area of my screen also if i can change this parametres using it. I know only function "MOVE" that don't permit me to have window that program opens already in user position/dimension but moves it in that area and i see window in previos position before move it. expandcollapse popup#NoTrayIcon #include <Winapi.au3> #include <MouseOnEvent.au3> HotKeySet("{ESC}", "Quit") _MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, 'Event') _MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, 'Event') Global Const $GWL_STYLE = 0xFFFFFFF0 ; Global Const $WS_BORDER = 0x00800000 Global $Up = 0 Global $Down = 0 Run("Slimboat.exe", "", @SW_MINIMIZE) While NOT WinExists("SlimBoat") Sleep(10) WEND ; Run Minimized & Then Restore Window to Remove its Border. If i RUN program normally it ; shows on screen its window with border & my script don't take effect to remove it after $hW = WinGetHandle("SlimBoat") $features = _WinAPI_GetWindowLong($hW, $GWL_STYLE) $NewFeatures = BitXOR($features, $WS_BORDER) _WinAPI_SetWindowLong($hW, $GWL_STYLE, $NewFeatures) Sleep(20) WinSetState ( $hW, "", @SW_RESTORE) ; I Would that Program opens its Window in same position with same dimension ; also user in previous session has changed them, but i know only "WINMOVE" WinMove($hW, "", @DesktopWidth/2, 1, @DesktopWidth/2-5, @DesktopHeight-30) ; If i remove MouseWheel command the ToolTip shows correctly Up and Down ; choice also if Tooltip don't disappear :-( While ProcessExists("SlimBoat.exe") If WinActive("SlimBoat") Then Select Case $up = 1 ;ToolTip ( "Change Up to Down" ) ;sleep(1000) MouseWheel("Down") $up = 0 Case $Down = 1 ;ToolTip ( "Change Down to Up" ) ;sleep(1000) MouseWheel("up") $Down = 0 EndSelect Endif ; Activate Again Mouse Event _MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT, 'Event') _MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT, 'Event') Wend Func Event($iEvent) Switch $iEvent Case $MOUSE_WHEELSCROLLUP_EVENT $up = 1 Case $MOUSE_WHEELSCROLLDOWN_EVENT $Down = 1 EndSwitch _MouseSetOnEvent($MOUSE_WHEELSCROLLUP_EVENT) ; *unset* the $iEvent to make MouseWheel Without Loop _MouseSetOnEvent($MOUSE_WHEELSCROLLDOWN_EVENT) EndFunc Func Quit() ProcessClose("Slimboat.exe") Exit EndFunc Edited January 23, 2014 by mercadantelaura Link to comment Share on other sites More sharing options...
mercadantelaura Posted January 27, 2014 Author Share Posted January 27, 2014 Nobody can explain me, where i'm wronging into my script, in order to invert wheel mouse direction when WinTitle of my program SlimBoat or other my program PowerDVD is active ? Thanks Link to comment Share on other sites More sharing options...
mercadantelaura Posted January 28, 2014 Author Share Posted January 28, 2014 The only way that i'm be able to code in order to invert mouse wheel direction under AutoIT is running default program that i want use follow starts my small script wrote into "AutoHotKey" code. .... Run("MyProgram.exe") Run("WheelSWAP.exe") #NoTrayIcon Loop { Sleep 250 IfWinNotExist, PowerDVD EXITAPP } #IfWinActive, PowerDVD WheelUp::WheelDown WheelDown::WheelUp if someone can explain me how convert correctly my autohotkey script into AutoIT i can use only one EXE for my purpose Thanks Link to comment Share on other sites More sharing options...
Inverted Posted January 28, 2014 Share Posted January 28, 2014 You can try changing the windows setting, read here: http://superuser.com/questions/310681/inverting-direction-of-mouse-scroll-wheel I spent some time doing it in AutoIt with a mouse hook, but .... nope. Doesn't work quite right. I actually download AHK to see how well that works and well, it works just fine with those 2 lines. Link to comment Share on other sites More sharing options...
mercadantelaura Posted January 28, 2014 Author Share Posted January 28, 2014 (edited) Thanks infact i have coded same 2 rows into my script AutoHotkey reading the exact link that you have post me. I have hopened that AutoIT have possibility to include this function. To answer to you : AutoHotkey function runs very well for me. When is active Porgram that i want wheel direction is Swapped and when the program close the script Auto-exit Edited January 28, 2014 by mercadantelaura Link to comment Share on other sites More sharing options...
Inverted Posted January 28, 2014 Share Posted January 28, 2014 Did you try changing that registry option to swap the direction of the wheel ? That's why I posted that link, not for the answer with the AHK code. Link to comment Share on other sites More sharing options...
mercadantelaura Posted January 28, 2014 Author Share Posted January 28, 2014 (edited) Yes i also thinked to this option, but is more rapid using AUTOHOTKEY. i have also download FlipWheel.exe but need Framework 4 that is to heavy for my system. Thanks again for suggestion Edited January 28, 2014 by mercadantelaura Link to comment Share on other sites More sharing options...
albertputinjobs Posted August 25, 2021 Share Posted August 25, 2021 Hello I have the same problem can anyone help me on how to flip mouse wheel... in autohotkey it is just two lines...I want to do this in AutoIT 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