This example writes the text hello world! into a field by calling the SendMessage DLL function from user32.dll.
DLL Declaration:
@Dll("user32.dll")
public interface IUserDll32Functions {
int SendMessageW(TestObject obj, int message, int wParam, Object lParam);
}
IUserDll32Functions user32Function = DllCall.createInProcessDllCall(IUserDll32Functions.class, desktop);
TextField textField = desktop.find("//TextField");
user32Function.SendMessageW(textField, WindowsMessages.WM_SETTEXT, 0, "my text");
IUserDll32Functions user32Function = DllCall.createAgentDllCall(IUserDll32Functions.class, desktop);
TextField textField = desktop.find("//TextField");
user32Function.SendMessageW(textField, WindowsMessages.WM_SETTEXT, 0, "my text");