Index: /trunk/MFCtooling/userlog/userlog.cpp
===================================================================
--- /trunk/MFCtooling/userlog/userlog.cpp	(revision 59)
+++ /trunk/MFCtooling/userlog/userlog.cpp	(revision 60)
@@ -1,4 +1,5 @@
 #include "stdafx.h"
 #include "userlog.h"
+#include "windowsx.h"
 
 #include <map>
@@ -370,31 +371,39 @@
 		msg->message==WM_LBUTTONDOWN || msg->message==WM_RBUTTONDOWN || msg->message==WM_MBUTTONDOWN ||
 		msg->message==WM_LBUTTONDBLCLK || msg->message==WM_RBUTTONDBLCLK || msg->message==WM_MBUTTONDBLCLK) {
-		if( msg->time>-1 ) {
-			pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.x\" value=\"%i\"/>", msg->pt.x);
-			pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.x\" value=\"%i\"/>", msg->pt.y);
-		}
-
-		if(msg->message == WM_LBUTTONUP)
-		{
-			//check the listBox selection, store it in "scrollPos"
-			//no selection = -1
-			//this is only working for listBoxes with style 'selection = single'
-			retVal = GetClassName(msg->hwnd, buffer, 128);
-			if( retVal >= -1  && retVal < MAXINT && !lstrcmpi(buffer, L"ListBox") )
+		
+		//if( msg->time>-1 )
+		//{
+			if(msg->message == WM_LBUTTONUP)
 			{
-				scrollPos = (int)SendMessage(msg->hwnd, LB_GETCURSEL, 0, 0);
-				pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos);
+				RECT r;
+				DWORD dCursorPos = GetMessagePos();
+				GetWindowRect(msg->hwnd, &r);
+
+				//dont log absolut coordinates but relativ ones so you can use them in rule "LeftClickRelativ"
+				pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.x\" value=\"%i\"/>", GET_X_LPARAM(dCursorPos)-r.left);
+				pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.y\" value=\"%i\"/>", GET_Y_LPARAM(dCursorPos)-r.top);
+
+
+				//check the listBox selection, store it in "scrollPos"
+				//no selection = -1
+				//this is only working for listBoxes with style 'selection = single'
+				retVal = GetClassName(msg->hwnd, buffer, 128);
+				if( retVal >= -1  && retVal < MAXINT && !lstrcmpi(buffer, L"ListBox") )
+				{
+					scrollPos = (int)SendMessage(msg->hwnd, LB_GETCURSEL, 0, 0);
+					pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos);
+				}
+
+
+				//check the TabControl selection, store it in "scrollPos"
+				//no selection = -1
+				retVal = GetClassName(msg->hwnd, buffer, 128);
+				if( retVal >= -1  && retVal < MAXINT && !lstrcmpi(buffer, L"SysTabControl32") )
+				{
+					scrollPos = (int)SendMessage(msg->hwnd, (UINT)4875, 0, 0);
+					pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos);
+				}
 			}
-
-
-			//check the TabControl selection, store it in "scrollPos"
-			//no selection = -1
-			retVal = GetClassName(msg->hwnd, buffer, 128);
-			if( retVal >= -1  && retVal < MAXINT && !lstrcmpi(buffer, L"SysTabControl32") )
-			{
-				scrollPos = (int)SendMessage(msg->hwnd, (UINT)4875, 0, 0);
-				pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos);
-			}
-		}
+		//}
 	}
 	if( msg->message==WM_MOUSEACTIVATE ) {
