Solved

MouseHookStruct in VC++ 4.0 framework

Posted on 1997-07-21
2
591 Views
Last Modified: 2013-12-03
I need to get hold of the extra information dwExtraInfo in the current valid MOUSEHOOKSTRUCT in the Visual C++ application framework.  It's for a 3D input device (FreeD) and the extra info is the Z parameter.  How do i do this?  Unfortunately the examples as always have been provided for non-Visual C++ .  Thanks for any help.
0
Comment
Question by:kingpie
2 Comments
 
LVL 1

Accepted Solution

by:
belov earned 30 total points
ID: 1401524
If you just need to obtain recent MOUSEHOOKSTRUCT
dwExtraInfo value, there are two ways. First is
to install mouse hook procedure.
Write LRESULT CALLBACK MouseProc(int nCode,
WPARAM wParam,  LPARAM lParam )
function, and you will get pointer to MOUSEHOOKSTRUCT
in lParam. This procedure must behave like other hook
procedures, i.e. return CallNextHookEx if nCode < 0.
You must not perform complex actions in hook procedure,
so you may want to save dwExtraField for later use.
This function must be registered as active hook
calling SetWindowHookEx with WH_MOUSE hook type.
And you'd better place hook code in DLL library,
if you want to install it system-wide.
Don't forget to UnhookWindowsHookEx
when terminating your programm.

The second is simplier but may not work.
You may call GetMessageExtraInfo() function,
which returns extra information supplied
with the message. In normal conditions
it will be the same as dwExtraInfo field of
MOUSEHOOKSTRUCT, so you don't need
hook at all, and call it on mouse notification
messages.

0
 

Author Comment

by:kingpie
ID: 1401525
Thank you, the second option GetMessageExtraInfo works perfectly.

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 105
How Does Quick Books store date / time? 3 104
Application vs Workbook.applicaiton 3 41
Please explain "Promise Pattern" and how it's used 2 57
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question