TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jon
NA
1
0
Global WH_MOUSE Hook can't read MOUSEHOOKSTRUCT from LParam
Aug 20 2007 3:06 PM
I have a C++ DLL that sends my C# application global messages that are hooked with WH_MOUSE (not WH_MOUSE_LL).
However, when I try to do this:
MOUSEHOOKSTRUCT MyMouseHookStruct = (MOUSEHOOKSTRUCT)Marshal.PtrToStructure(m.LParam, typeof(MOUSEHOOKSTRUCT));
For a message that belongs to a window other than mine I get this error:
"AccessVioliationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Is this by design? "m.LParam" isn't 0 (or null), it is above zero, so I'm assuming it should be pointing to a valid memory location, but it fails everytime, unless it's for my own window.
Does anyone have any thoughts?
Thanks,
Jon
Reply
Answers (
0
)
Buttons too big in Vista
HELP..