This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 How to send mouse wheel?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

adyyadyy

11 Posts

Posted - 12/06/2012 :  04:07:26  Show Profile
hello
How to send mouse wheel?
Thanks~

Rob

USA
2615 Posts

Posted - 12/06/2012 :  07:00:54  Show Profile  Visit Rob's Homepage
The code below is a slight modification of sending Ctrl+MouseWheel from this post (code below doesn't involve the Ctrl key). The wheel message is sent to the window where the gesture began.
local WM_MOUSEWHEEL = 0x20A
local WHEEL_POS = 0x00780000 --standard 120 tick of a mouse wheel scroll up, pre-shifted
local WHEEL_NEG = 0xff880000 --standard -120 tick of a mouse wheel scroll down, pre-shifted

--Mouse Wheel Up
acPostMessage(acGetWindowByPoint(gsx, gsy), WM_MOUSEWHEEL, WHEEL_POS, bit32.lshift(gsy,16)+gsx)

--Mouse Wheel Down
acPostMessage(acGetWindowByPoint(gsx, gsy), WM_MOUSEWHEEL, WHEEL_NEG, bit32.lshift(gsy,16)+gsx)
Go to Top of Page

adyyadyy

11 Posts

Posted - 12/06/2012 :  09:18:58  Show Profile
I got it~
Thanks~
Go to Top of Page

plunt

Italy
88 Posts

Posted - 12/22/2012 :  06:14:25  Show Profile
Do it send a page top or page bottom scrolling?
Go to Top of Page

Rob

USA
2615 Posts

Posted - 12/22/2012 :  09:44:10  Show Profile  Visit Rob's Homepage
You should be able to use the example in this thread:

http://www.strokesplus.com/forum/topic.asp?TOPIC_ID=416

Defining:

SB_TOP = 0x06
SB_BOTTOM = 0x07

Go to Top of Page

plunt

Italy
88 Posts

Posted - 12/22/2012 :  10:06:12  Show Profile
ty, they is missing. :)
Go to Top of Page

adyyadyy

11 Posts

Posted - 12/26/2012 :  03:31:43  Show Profile
acSendKeys("{HOME}")
or
acSendKeys("{END}")

Go to Top of Page

Chris

28 Posts

Posted - 03/21/2013 :  02:25:06  Show Profile
Hmmm...it seems not all windows with scrollbar can be scrolled by using the sendMessage, such as Firefox and Ms Word 2003.
Is there any other method to do it?

I know an old program called Pointix Scroll ++ that is able to scroll on those two apps.
Available here: http://carltonbale.com/how-to-scroll-if-your-mouse-has-no-scroll-wheel/
It scrolls depends on the windows setting (3 lines by default), I thought it works by sending sendMessage. However, some windows that do not work with sendMessage can work with this app.

Any idea?
Go to Top of Page

Rob

USA
2615 Posts

Posted - 03/21/2013 :  07:53:59  Show Profile  Visit Rob's Homepage
Some apps are just unique in the way they choose to handle things. The Word issue was specifically mentioned in this thread with an apparent workaround. There's always a way to make things work, just that some programs have their own approach which doesn't fit with most apps and tweaking is needed for those. It's likely that the app you mentioned has specific checks for certain apps, to handle them differently; but S+ isn't a scroll-centric app so there was never a reason to have it in the code.
Go to Top of Page

Chris

28 Posts

Posted - 03/21/2013 :  08:17:46  Show Profile
No..no, I was not asking you to put a code to scroll in the StrokesPlus. I was thinking maybe to create a .dll to accommodate StrokesPlus for scrolling. Therefore, I wanted to know maybe you knew different method that could work for most of the windows.
Just that.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 03/21/2013 :  08:21:50  Show Profile  Visit Rob's Homepage
I wasn't assuming you were asking for it to be added, no worries

This isn't something I've spent much time investigating, so I don't have any tips for you. In most cases, I find using Spy++ the best method for getting to the root of exactly how apps handle messages, watching what happens when I do something as a normal user would, then seeing what the difference is when it's synthesized in some fashion. Of course, if an app installs a mouse hook (be it local [app-only] or global [system-wide]), that's very difficult to track down; but I don't think that's often the case.
Go to Top of Page

Chris

28 Posts

Posted - 03/21/2013 :  09:16:48  Show Profile
Nice, I will try to monitor it using Spy++. Hope it doesn't use hook to make those windows scroll.
Thanks!

It works! By using Spy++ I was able to catch the postMessage. Now we can scroll on Firefox and Ms Word 2007.

Scroll up: acPostMessage(acGetWindowByPoint(gsx, gsy), WM_MOUSEWHEEL, 0x00780000, 0x01F90396)
Scroll down: acPostMessage(acGetWindowByPoint(gsx, gsy), WM_MOUSEWHEEL, 0xFF880010, 0x016C0347)

Some windows may need WM_VSCROLL to scroll. Therefore, if WM_MOUSEWHEEL doesn't work, WM_VSCROLL can be tried.
Scroll up: acPostMessage(acGetWindowByPoint(gsx, gsy), WM_VSCROLL, 0x00, nil)
Scroll down: acPostMessage(acGetWindowByPoint(gsx, gsy), WM_VSCROLL, 0x01, nil)

To make sure scroll works on any window, I use them both and it seems a window cannot receive both messages. However, it needs further investigation.

Edited by - Chris on 03/23/2013 12:59:54
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000