auto change active application

Well, i have running two applications (my apps, so I can change their code) on
two monitors. Is there a way, how can I set the active application by moving the
mouse pointer over the one or another application's form, so the applications get
the focus, when the mouse pointer is over it?

Thanks.
J.

Comments

  • : Well, i have running two applications (my apps, so I can change their code) on
    : two monitors. Is there a way, how can I set the active application by moving the
    : mouse pointer over the one or another application's form, so the applications get
    : the focus, when the mouse pointer is over it?
    :
    : Thanks.
    : J.
    :
    :
    You could try to write an TForm.OnMouseMove() event, but I'm not sure that will work. Otherwise you need to hook an event into the windows event chain and then both applications need to be able to find if the mouse is over one of them, so they can activate eachother if necessary. I don't know if that will work or the code for that.
  • : : Well, i have running two applications (my apps, so I can change their code) on
    : : two monitors. Is there a way, how can I set the active application by moving the
    : : mouse pointer over the one or another application's form, so the applications get
    : : the focus, when the mouse pointer is over it?
    : :
    : : Thanks.
    : : J.
    : :
    : :
    : You could try to write an TForm.OnMouseMove() event, but I'm not sure that will work. Otherwise you need to hook an event into the windows event chain and then both applications need to be able to find if the mouse is over one of them, so they can activate eachother if necessary. I don't know if that will work or the code for that.
    :

    OK, I know how to detect, that mouse pointer is over the form, but how can I set the form active?
    J.
  • : : : Well, i have running two applications (my apps, so I can change their code) on
    : : : two monitors. Is there a way, how can I set the active application by moving the
    : : : mouse pointer over the one or another application's form, so the applications get
    : : : the focus, when the mouse pointer is over it?
    : : :
    : : : Thanks.
    : : : J.
    : : :
    : : :
    : : You could try to write an TForm.OnMouseMove() event, but I'm not sure that will work. Otherwise you need to hook an event into the windows event chain and then both applications need to be able to find if the mouse is over one of them, so they can activate eachother if necessary. I don't know if that will work or the code for that.
    : :
    :
    : OK, I know how to detect, that mouse pointer is over the form, but how can I set the form active?
    : J.
    :
    You can try to use TForm.SetFocus(), or TForm.FocusControl(Self).
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories