I am trying to send keystrokes to a window/s that is not in focus using sendmessage. Finding the window's handle using its name is simple enough, however what I want is to get the handle by clicking on the window or puting that window into focus (whichever is easier) bec. I have multiple copies of the window open at the same time with the same name & I want to be able to choose which one of those I send the keystrokes to by clicking/focusing (then minimizing after so i can work on another window).

I've tried google however I can't seem to find an example related to what i want to do. Found some stuff about getting the handle by hovering, but the code was in C#. Any help please? Thanks in advance. :)

8 Years
Discussion Span
Last Post by flushfire

nevermind, i just found out that findwindow will take the handle of the last window that took focus. :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.