k3ph wrote:
So are you alleging that ControlSend and Postmessage would have the same effect?
Since you ask, I assume you didn't know ControlSend
uses PostMessage. It posts WM_KEYDOWN and WM_KEYUP messages.
Quote:
There is even a slightly difference between sendmessage and postmessage (it shouldn't have such difference, don't ask me why, go test it).
PostMessage does not need to wait for the target window to process the message. SendMessage does.
Quote:
Users want to hold keys like ctrl, alt, shift, space for long time and press simultaneasly other keys, ControlSend can't handle that.
Perhaps for modifier keys this is the issue:
the help file wrote:
By default, modifier keystrokes (Control, Alt, Shift, and Win) are sent as they normally would be by the Send command. This allows command prompt and other console windows to properly detect uppercase letters, control characters, etc. It may also improve reliability in other ways.
However, in some cases these modifier events may interfere with the active window, especially if the user is actively typing during a ControlSend or if the Alt key is being sent (since Alt activates the active window's menu bar). This can be avoided by explicitly sending modifier up and down events as in this example:
ControlSend, Edit1, {Alt down}f{Alt up}, Untitled - Notepad
For other keys, ControlSend posts WM_KEYDOWN/WM_KEYUP messages. In theory, the only way it could fail is in the target window's processing of the messages/handling of keyboard state.
k3ph wrote:
users have been reporting this a long time and no one cared about it
It's the first I've heard about it.
Quote:
When you input a lot of text data through controlsend, if you try to send {enter} after them, it would require a sleep because the enter key is sent before the text message completes.
ControlSend doesn't post the message for a key until after the message for a previous key has been posted. Therefore, I suspect the target window's handling of the messages.
Quote:
PostMessage is a command with more broad usage capability, there is nothing illogical on that.
I was pointing out that
your function can send only a single type of message with any given call. If it could send both keystrokes and mouse clicks in a single call, that may be an advantage over ControlSend/ControlClick. Since it can't, your argument that ControlSend can't click is pointless, as a user can easily ControlClick.
The main reason for my posts is that you say the function is intended for lazy people and newcomers, but I cannot see how it could be easier, quicker, more intuitive or more effective. I say lazy people and newcomers are better off sticking with the built-in methods.