c# 向编辑框发送特定文字

来源:百度知道 编辑:UC知道 时间:2024/06/17 22:26:56
假设已经获得该编辑框的句柄为whnd怎么向该编辑框发送特定文字。要求用sendmessage()。知道的朋友帮下忙谢谢..........

using System;
using System.Runtime.InteropServices;

internal static class Program
{
[DllImport("user32.dll")]
private static extern int SendMessage(IntPtr hWnd, uint uMsg, int wParam, string lParam);

private const uint WM_SETTEXT = 0x000C;

private static void SetText(IntPtr hwnd, string text)
{
SendMessage(hwnd, WM_SETTEXT, 0, text);
}

private static void Main()
{
SetText((IntPtr)0x002307F8, "our business is life itself.");
}
}

进程间通信?