MOUSEHOOKSTRUCT* str;
THen make it from lparam,
LRESULT CALLBACK MouseProc( int nCode, WPARAM wParam, LPARAM lParam ) { str = (MOUSEHOOKSTRUCT *) lParam; ...
Then i catch mousemovements
case WM_MOUSEMOVE: wParm = AU3_WM_MOUSEMOVE; fromp = WindowFromPoint(str->pt);
Then validate and try not to send to many messages...
if (fromp != currentwindow) { currentwindow= fromp; PostMessage(m_hHwndMouse, wParm,(WPARAM)( (MOUSEHOOKSTRUCT*) lParam )->hwnd, LPARAM(fromp)); } break;
This sends the mousemove message along with hwnd to my autoit app which inspects hwnd and if that hwnd is not active it activates it.
Func mouse_func($hWndGUI, $MsgID, $wParam, $lParam) Select Case $MsgID = $WM_AUTOITMOUSEMOVE If GUICtrlRead($activateundermouse) = 1 And $sitting = 0 Then ;Local $starttime = _Timer_Init() If StringInStr(WinGetTitle($lParam), "ID=") Then If Not WinActive($lParam) Then ;ConsoleWrite("HOVERING NEW, Activate It: " & WinGetTitle($lParam) & @LF) WinActivate($lParam) EndIf ;ConsoleWrite("diff is > " & _Timer_Diff($starttime) & @LF) EndIf EndIf
This is how i am activating window that is hovered by the mouse but the problem is that rarely autoit wont read the message that should signal new window being hovered(or the dll with hook didnt send it, i dont know)
Also if the window is overlapping another window and both of them are valid windows that should be activate once hovered i get flickering as autoit is constantly trying to activate the current window and the overlapped one, in a loop
Is there something that perhaps i missed or could be doing wrong here?
Also i am using Opt("WinWaitDelay", 100)
Edited by Aktonius, 15 July 2011 - 10:21 PM.





