C# 如何发送消息选项卡&;向上箭头发送?在C中#

C# 如何发送消息选项卡&;向上箭头发送?在C中#,c#,C#,当实际传递字符串时,它被传递给编辑类。 在此之前,程序启动后,uparrow->enter->string编辑类 这样地。 但目前未传递向上箭头键和回车键。 有什么问题?我附上我的代码。基本上,在运行程序时,第一个表单有两个复选框,其中选中的复选框位于底部。在这里,如果单击程序窗口后单击向上箭头,复选框按钮将从底部移动到顶部。 然后,按Enter键,第二个窗体将出现。在第二个表单上点击两次选项卡后,输入所需的数字 您需要再次按Enter键登录。 您应该每天重新启动计算机来尝试此过程。 我通过go

当实际传递字符串时,它被传递给编辑类。 在此之前,程序启动后,
uparrow->enter->string编辑类
这样地。 但目前未传递向上箭头键和回车键。
有什么问题?我附上我的代码。

基本上,在运行程序时,第一个表单有两个复选框,其中选中的复选框位于底部。在这里,如果单击程序窗口后单击向上箭头,复选框按钮将从底部移动到顶部。 然后,按Enter键,第二个窗体将出现。在第二个表单上点击两次选项卡后,输入所需的数字 您需要再次按Enter键登录。 您应该每天重新启动计算机来尝试此过程。 我通过google ring找到的是输入所需的数字 这将跳过我自己的第一个表单,并执行我在第二个表单中找到的源代码,并将其输入到第一个文本框中。 所以我需要做的就是按tab键和箭头键上方的箭头键。 你必须想办法。 我现在能做的就是在第一个焦点文本框中输入数字、简单字母等。
我不会说英语。我不是母语人士,谢谢阅读。

IntPtr sendmages(IntPtr hWnd、intumsg、IntPtr wParam、IntPtr lParam)@GSerg。。不管用。但是谢谢
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
public class Program
{
    //include FindWindowEx
    [DllImport("user32.dll")]
    public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);


    [DllImport("user32.dll")]
    public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, int lParam);

    //include SendMessage
    [DllImport("user32.dll")]
    public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, string lParam);

    //this is a constant indicating the window that we want to send a text message
    const int WM_SETTEXT = 0X000C;
    const int WM_KEYDOWN = 0x0100;
    const int WM_KEYUP = 0x0101;
    static void Main(string[] args)
    {
        //getting notepad's process | at least one instance of notepad must be running
        Process notepadProccess = Process.GetProcessesByName("Codns3")[0];

        //getting notepad's textbox handle from the main window's handle
        //the textbox is called 'Edit'
        IntPtr notepadTextbox = FindWindowEx(notepadProccess.MainWindowHandle, IntPtr.Zero, "Edit", null);//창핸들
        IntPtr codnsButton = FindWindowEx(notepadProccess.MainWindowHandle, IntPtr.Zero, "#32770", null);//창핸들
        //sending the message to the textbox 0x26
        //SendMessage(codnsButton, WM_KEYDOWN, 0x26, 0x26);
        //SendMessage(codnsButton, WM_KEYUP, 0x26, 0x26);
        SendMessage((System.IntPtr)00430350, 0021, 00430350, 02010001);
        SendMessage(notepadTextbox, WM_SETTEXT, 0, "172846200035");
    }
}