the example of AHK Command source code Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
euras
Posts: 411
Joined: 05 Nov 2015, 12:56

the example of AHK Command source code

07 May 2019, 04:36

Hi,
I'm curious how the source code of the commands in AHK looks like. Maybe someone has an example?
I.e. we use the syntax

Code: Select all

Send, this is a text
, but what is behind that Send?
User avatar
Alguimist
Posts: 373
Joined: 05 Oct 2015, 16:41
Contact:

Re: the example of AHK Command source code  Topic is solved

07 May 2019, 15:47

Send is coded in keyboard_mouse.cpp, in a very long function called SendKeys.

It is essentially WM_KEYDOWN via PostMessage.

Code: Select all

Send(hWnd, String) {
    Loop % StrLen(String) {
        PostMessage 0x100, GetKeyVK(SubStr(String, A_Index, 1)), 1,, ahk_id %hWnd% ; WM_KEYDOWN
    }
}
In the Help folder of AutoGUI, there is a file called AHK-WinAPI.htm. I believe that more than 80% of AHK commands, functions and variables are briefly described in it, but Send is not there yet.

Return to “Ask For Help”

Who is online

Users browsing this forum: anhnha, mikeyww, plautus and 36 guests