Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 24 FEB 1998 11:20:50AM Jeff Word Enterprises wrote:

Is there a way to trap when the mouse hovers over a standard button (a button without a bitmap)? Is there an event that is triggered? All help appreciated.


At 24 FEB 1998 01:26PM Blaise (Revelation) wrote:

Hey Jeff,

If you catch the 'MOUSEMOVE' event over the button you can call whatever code you wish to execute. Try this:

1) In the CREATE event for the form put this code:

Send_Message(@WINDOW: '.BUTTON_1', 'QUALIFY_EVENT', '0x0200', 1)

2) In the WINMSG event for the form put this code:

Declare Subroutine MSG

Msg (@WINDOW , "This is the MOUSEMOVE event for the button")

This code is going display the message box when the mouse if moved over the button.

Good Luck…

-Blaise


At 24 FEB 1998 04:02PM Aaron Kaplan wrote:

Check out the stuff in the Examples apps.

Should give you everything you need.

apk@sprezzatura.com

Sprezzatura, Inc.

www.sprezzatura.com_zz.jpg


At 25 FEB 1998 12:33AM Barry Stevens wrote:

Blaise

Where did you get '0x0200' from for mousemove.

Barry


At 25 FEB 1998 07:38AM Bryan Feddish wrote:

from windows.h, here are the rest.

/ Mouse input support ***/

HWND WINAPI SetCapture(HWND);

void WINAPI ReleaseCapture(void);

HWND WINAPI GetCapture(void);

BOOL WINAPI SwapMouseButton(BOOL);

/* Mouse input messages */

#define WM_MOUSEMOVE 0x0200

#define WM_LBUTTONDOWN 0x0201

#define WM_LBUTTONUP 0x0202

#define WM_LBUTTONDBLCLK 0x0203

#define WM_RBUTTONDOWN 0x0204

#define WM_RBUTTONUP 0x0205

#define WM_RBUTTONDBLCLK 0x0206

#define WM_MBUTTONDOWN 0x0207

#define WM_MBUTTONUP 0x0208

#define WM_MBUTTONDBLCLK 0x0209

/* Mouse input message range */

#define WM_MOUSEFIRST 0x0200

#define WM_MOUSELAST 0x0209

/* Mouse message wParam key states */

#ifndef NOKEYSTATES

#define MK_LBUTTON 0x0001

#define MK_RBUTTON 0x0002

#define MK_SHIFT 0x0004

#define MK_CONTROL 0x0008

#define MK_MBUTTON 0x0010

#endif /* NOKEYSTATES */

/* Non-client mouse messages */

#define WM_NCMOUSEMOVE 0x00A0

#define WM_NCLBUTTONDOWN 0x00A1

#define WM_NCLBUTTONUP 0x00A2

#define WM_NCLBUTTONDBLCLK 0x00A3

#define WM_NCRBUTTONDOWN 0x00A4

#define WM_NCRBUTTONUP 0x00A5

#define WM_NCRBUTTONDBLCLK 0x00A6

#define WM_NCMBUTTONDOWN 0x00A7

#define WM_NCMBUTTONUP 0x00A8

#define WM_NCMBUTTONDBLCLK 0x00A9

Bryan


At 25 FEB 1998 08:20AM Dave Pociu wrote:

Hi Bryan,

Would you happen to know what values the wheel on the new mice generates when it's rotated up and down?


At 25 FEB 1998 10:02AM Bryan Feddish wrote:

I was quietly waiting in the background for someone else to come up with that info. I hate the thought of shelling out $35 - $65 for one of those mice but I guess I'll have to soon.

After thinking about it though, what does that wheel do? Does it just move the scroll bars?

Bryan


At 25 FEB 1998 11:51AM Dave Pociu wrote:

In most (Microsoft) applications, yes. You can also click it and then move the mouse up and down to scroll the screen. The farther up or down you are from the original point where you clicked, the faster the scrolling. Scrolling stops when you click the wheel a second time. (Yes, it's a wheel, it's a mouse button, it's Superm… - Well, no, we won't go that far !)

Anyway, it is a handy thing when scrolling through Internet pages or any other multipage screen.

So hopefully someone has the API secrets for it.


At 25 FEB 1998 01:32PM Bryan Feddish wrote:

Has anyone tried the SPY program on it?

Bryan


At 25 FEB 1998 04:39PM Jeff Word Enterprises wrote:

Thanks everyone! One more question:

I am triggering the event when the mouse hovers over the button! Is there a way to know when they move off the button? This way I can stop what I triggered when they came onto the button.


At 25 FEB 1998 05:27PM Cameron Revelation wrote:

Jeff,

Is there a way to know when they move off the button?

Windows has neither mouse enter or mouse exit messages. A combination of several things are used in Windows to detect mouse exit:

1) When a window detects "mouse move", if it is not the last known mouse-over window, it tells the last known mouse-over window "mouse exit", then tells itself "mouse enter", and then goes on to process "mouse move"

2) When a window receives "mouse enter", it sets the last known mouse-over window to itself, and if there was no last known mouse-over window, it creates a timer

3) When the timer fires, the position of the mouse is determined, and if it is not over the last known mouse-over window, then the the last known mouse-over window is told "mouse exit" and sets the last known mouse-over window to nothing

In the above explanation, "window" refers to the containing window as well as each of its controls. The number 1 above is fairly complex; I would suggest just using the timer.

Cameron Purdy

info@revelation.com


At 25 FEB 1998 05:50PM Cameron Revelation wrote:

The message number is 0x20A (522). From Microsoft's SDK online:

WM_MOUSEWHEEL

The WM_MOUSEWHEEL message is sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until it finds a window that processes it.

WM_MOUSEWHEEL

fwKeys=LOWORD(wParam); key flags zDelta=(short) HIWORD(wParam); wheel rotation

xPos=(short) LOWORD(lParam); horizontal position of pointer yPos=(short) HIWORD(lParam); vertical position of pointer

Parameters

fwKeys

Value of the low-order word of wParam. Indicates whether various virtual keys are down. This parameter can be any combination of the following values: Value Description

MK_CONTROL Set if the ctrl key is down.

MK_LBUTTON Set if the left mouse button is down.

MK_MBUTTON Set if the middle mouse button is down.

MK_RBUTTON Set if the right mouse button is down.

MK_SHIFT Set if the shift key is down.

zDelta

The value of the high-order word of wParam. Indicates the distance that the wheel is rotated, expressed in multiples or divisions of WHEEL_DELTA, which is 120. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user.

xPos

Value of the low-order word of lParam. Specifies the x-coordinate of the pointer, relative to the upper-left corner of the screen.

yPos

Value of the high-order word of lParam. Specifies the y-coordinate of the pointer, relative to the upper-left corner of the screen.

Remarks

The zDelta parameter will be a multiple of WHEEL_DELTA, which is set at 120. This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta.

The delta was set to 120 to allow Microsoft or other vendors to build finer-resolution wheels in the future, including perhaps a freely-rotating wheel with no notches. The expectation is that such a device would send more messages per rotation, but with a smaller value in each message. To support this possibility, you should either add the incoming delta values until WHEEL_DELTA is reached (so for a given delta-rotation you get the same response), or scroll partial lines in response to the more frequent messages. You could also choose your scroll granularity and accumulate deltas until it is reached.

QuickInfo

Windows NT: Use version 4.0 or later.
Windows: Use Windows 98.
Windows CE: Unsupported.
Header: Declared in winuser.h.

At 26 FEB 1998 08:18AM Aaron Kaplan wrote:

Have you tried cruising through Microsoft's web site?

apk@sprezzatura.com

Sprezzatura, Inc.

www.sprezzatura.com_zz.jpg


At 26 FEB 1998 02:22PM Dave Pociu wrote:

Looks like this is exactly what I was after.

Thank you.


At 27 FEB 1998 02:07AM Barry Allyn wrote:

#define WM_MBUTTONDOWN 0x0207

#define WM_MBUTTONUP 0x0208

#define WM_MBUTTONDBLCLK 0x0209

#define WM_MOUSEWHEEL 0x020A

WM_MOUSEWHEEL is sent when the wheel is scrolled. You should scroll the window up/down. the wheel is also a button. Click and holding the wheel down should pan a window (if appropriate). Shift + mousewheel spin should zoom in/out (if appropriate). There are no official standards on how to behave, but there was an article in MSJ late last year that described the rules Microsoft wants you to follow. Most apps that support the IntelliMouse consistently trap WM_MOUSEWHEEL and then VScroll, but modifier keys + scroll/click behavior is not as consistent.

Barry Allyn

Visio Corporation

barrya@visio.com

www.visio.com


At 27 FEB 1998 12:28PM Jeff Word Enterprises wrote:

Thanks! Now I think I understand the theory. How do you actually do this? How do you look for "mouse exit" or the last known mouse-over window? Do you loop and watch a variable until it is set a certain way? (sort of like looping and watching the handle of a window until the window is closed)


At 02 MAR 1998 07:44AM Cameron Revelation wrote:

Jeff,

Start by looking at the code for the main EXAMPLE window with the buttons that activate when the mouse goes over them.

Cameron Purdy

Revelation Software

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/ff326345b425f3b0852565b50059cc8e.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1