Changeset 60
- Timestamp:
- 06/14/11 11:38:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MFCtooling/userlog/userlog.cpp
r49 r60 1 1 #include "stdafx.h" 2 2 #include "userlog.h" 3 #include "windowsx.h" 3 4 4 5 #include <map> … … 370 371 msg->message==WM_LBUTTONDOWN || msg->message==WM_RBUTTONDOWN || msg->message==WM_MBUTTONDOWN || 371 372 msg->message==WM_LBUTTONDBLCLK || msg->message==WM_RBUTTONDBLCLK || msg->message==WM_MBUTTONDBLCLK) { 372 if( msg->time>-1 ) { 373 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.x\" value=\"%i\"/>", msg->pt.x); 374 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.x\" value=\"%i\"/>", msg->pt.y); 375 } 376 377 if(msg->message == WM_LBUTTONUP) 378 { 379 //check the listBox selection, store it in "scrollPos" 380 //no selection = -1 381 //this is only working for listBoxes with style 'selection = single' 382 retVal = GetClassName(msg->hwnd, buffer, 128); 383 if( retVal >= -1 && retVal < MAXINT && !lstrcmpi(buffer, L"ListBox") ) 373 374 //if( msg->time>-1 ) 375 //{ 376 if(msg->message == WM_LBUTTONUP) 384 377 { 385 scrollPos = (int)SendMessage(msg->hwnd, LB_GETCURSEL, 0, 0); 386 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos); 378 RECT r; 379 DWORD dCursorPos = GetMessagePos(); 380 GetWindowRect(msg->hwnd, &r); 381 382 //dont log absolut coordinates but relativ ones so you can use them in rule "LeftClickRelativ" 383 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.x\" value=\"%i\"/>", GET_X_LPARAM(dCursorPos)-r.left); 384 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"point.y\" value=\"%i\"/>", GET_Y_LPARAM(dCursorPos)-r.top); 385 386 387 //check the listBox selection, store it in "scrollPos" 388 //no selection = -1 389 //this is only working for listBoxes with style 'selection = single' 390 retVal = GetClassName(msg->hwnd, buffer, 128); 391 if( retVal >= -1 && retVal < MAXINT && !lstrcmpi(buffer, L"ListBox") ) 392 { 393 scrollPos = (int)SendMessage(msg->hwnd, LB_GETCURSEL, 0, 0); 394 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos); 395 } 396 397 398 //check the TabControl selection, store it in "scrollPos" 399 //no selection = -1 400 retVal = GetClassName(msg->hwnd, buffer, 128); 401 if( retVal >= -1 && retVal < MAXINT && !lstrcmpi(buffer, L"SysTabControl32") ) 402 { 403 scrollPos = (int)SendMessage(msg->hwnd, (UINT)4875, 0, 0); 404 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos); 405 } 387 406 } 388 389 390 //check the TabControl selection, store it in "scrollPos" 391 //no selection = -1 392 retVal = GetClassName(msg->hwnd, buffer, 128); 393 if( retVal >= -1 && retVal < MAXINT && !lstrcmpi(buffer, L"SysTabControl32") ) 394 { 395 scrollPos = (int)SendMessage(msg->hwnd, (UINT)4875, 0, 0); 396 pos += swprintf_s(msgBuffer+pos,bufsize-pos,L"<param name=\"scrollPos\" value=\"%i\"/>", scrollPos); 397 } 398 } 407 //} 399 408 } 400 409 if( msg->message==WM_MOUSEACTIVATE ) {
Note: See TracChangeset
for help on using the changeset viewer.