Solved

How can I catch a MoseMove over annother app. Window ?

Posted on 2002-03-05
1
199 Views
Last Modified: 2013-11-20
Hi

I want to catch the MouseMessages from annother applications window. SetCapture doesn´t catch the move messages. How can I do that ?
0
Comment
Question by:AndersCarlsson
1 Comment
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 200 total points
ID: 6843693
Hi AndersCarlsson,
       You have to set windows hook for mouse.

Create a dll, and write this code into it,
LoadTheDll from your application.

The code for setting up the hooks will look like this:

hhookMouse = SetWindowsHookEx(WH_MOUSE,
   (HOOKPROC) MouseFunc,  hInstance, 0);

…which will cause the following hook function to be called:

LRESULT CALLBACK MouseFunc(int nCode, WPARAM wParam, LPARAM lParam)
{
if ( nCode >= 0 )
         return 1;
else
   return(CallNextHookEx(hhookMouse, nCode, wParam, lParam));
}

Don't forget to unhook your hook before you exit by calling the following:

UnhookWindowsHookEx(hhookMouse);

GOOD LUCK
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 88
Prevent this page from creating additional dialogs. 3 268
changeXy challenge 13 58
mapAB Challlenge 35 89
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now