02-06-2007 03:29 AM
Vasanth,
Again, you need mouse hook. In the other words you must create DLL, where you should register your hook by calling following function:
hook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC)msghook, hInst, 0);
Application instance you will get from DllMain something like that:
BOOL APIENTRY DllMain( HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
{
switch(Reason)
case DLL_PROCESS_ATTACH:
hInst = hInstance;
...
So, now every time when mouse moved your hook callback function will be called:
static LRESULT CALLBACK msghook(UINT nCode, WPARAM wParam, LPARAM lParam)
{
LPMSG msg = (LPMSG)lParam;
if(msg->message == WM_MOUSEMOVE || msg->message == WM_NCMOUSEMOVE)
//Do something for inform LabVIEW about movement, for example set LabVIEW occurence
return CallNextHookEx(hook, nCode, wParam, lParam);
} // msghook
Do not forget to remove your hook when application will be finished:
UnhookWindowsHookEx(hook);
Its a quite terrible to debug this, but in general it should work.
with best regards,
Andrey.
02-06-2007 05:29 AM
Andrey,
Thanks. Let me try this.
Thanks,
Vasanth.
02-07-2007 04:39 AM
Andrey,
I dont have a visual studio installed in my pc. Can you please provide the functions you have given as dlls?
Thanks,
Vasanth.
02-07-2007 05:16 AM
02-07-2007 10:54 PM
Andrey,
Thanks. I will look into it.
Thanks,
Vasanth.