Jump to content
Sign in to follow this  
Oxin8

MouseWheel for minimized window

Recommended Posts

Oxin8

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
LxP

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
SmOke_N

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?

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.

Share this post


Link to post
Share on other sites
SmOke_N

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


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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.