Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6155017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:21:49+00:00 2026-05-23T20:21:49+00:00

Basically i make mousestruct in the hook MOUSEHOOKSTRUCT* str; Then make it from lparam,

  • 0

Basically i make mousestruct in the hook

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:21:49+00:00Added an answer on May 23, 2026 at 8:21 pm

    You can use the blocking SendMessage instead depending on surrounding implementation. PostMessage will send to the window message queue but may not have the priority you expect as it returns without waiting for the processing of the message.

    Also check out SetCapture and ReleaseCapture to change which window is capturing mouse events based on a hit test in mouse move as an alternative to forwarding. Only one window at a time can capture mouse events using these functions so that will solve your flicker issue of the windows forwarding messages to each other most likely.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically want to make an intent and pass it to a service from
Basically I want to make sure I will always get the computer's name rather
Python 2.6 was basically a stepping stone to make converting to Python 3 easier.
Basically I am trying to restart a service from a php web page. Here
I am writing a program that will basically make a xml copy of most
I'm a student learning PHP. I basically make the stuff work, but never wondered
(Very) basically my app is just a load of information collected from the internet
I'm running a loop basically that will make an array that contains a million
Basically I am trying to make a simple form that allows the user to
I want to basically create a light that will make it so that its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.