Sign in to follow this  
Followers 0
Oxin8

MouseWheel for minimized window

9 posts in this topic

#1 ·  Posted (edited)

Is there a way I can simulate moving the mouse wheel on a minimized window?

Also, is there something I can do so the autoit icon never shows in the system tray? i have opt("TrayIconHide", 1) but it still pops up for a split second.

EDIT: I actually did some work and made a function that does it. Credit to Insolence for his _MouseClickPlus function that helped me make this and Larry for the _MakeLong function it uses.

Func _MouseWheelPlus($Window, $direction, $clicks)
    Local $WM_MOUSEWHEEL    =  0x020A
    $MouseCoord = MouseGetPos()
        $X = $MouseCoord[0]
        $Y = $MouseCoord[1]
    If $direction = "up" then
        $WheelDelta = 120
    Else
        $WheelDelta = -120
    Endif
    For $i = 0 to $clicks
    DllCall("user32.dll", "int", "SendMessage", _
            "hwnd",  WinGetHandle( $Window ), _
            "int",   $WM_MOUSEWHEEL, _
            "long",   _MakeLong(0,$WheelDelta), _
            "long",  _MakeLong($X, $Y))
    Next
EndFunc

Func _MakeLong($LoWord,$HiWord)
  Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc
Edited by Oxin8

Share this post


Link to post
Share on other sites



Placing this at the start of your script will prevent the tray icon from showing initially:

#NoTrayIcon

Share this post


Link to post
Share on other sites

does anyone have any ideas? can this even be done with autoit or do i need to find something else to do it?

I wouldn't even know how to test if that worked or not. What are you needing it for?

[center]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.[/center]

Share this post


Link to post
Share on other sites

On winamp, the mouse wheel adjusts the volume and i wanted to know if i could do it while the window is minimized. I know i can change the volume other ways but i wanted to do it with the wheel if it was possible.

Share this post


Link to post
Share on other sites

Maybe you can do it with MouseClickPlus() ... http://www.autoitscript.com/forum/index.php?showtopic=7112#


[center]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.[/center]

Share this post


Link to post
Share on other sites

Good Job... thought you might be able to manipulate that a bit.


[center]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.[/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0