zoukankan      html  css  js  c++  java
  • C#调用记事本并填写内容

    using System.Runtime.InteropServices;

    using System.Diagnostics;
     
    [DllImport("User32.DLL")]
    public static extern int SendMessage(IntPtr hWnd,
        uint Msg, int wParam, string lParam);
    [DllImport("User32.DLL")]
    public static extern IntPtr FindWindowEx(IntPtr hwndParent,
        IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
    public const uint WM_SETTEXT = 0x000C;
    private void button1_Click(object senderEventArgs e)
    {
        Process vProcess = Process.Start("notepad.exe");
        while (vProcess.MainWindowHandle == IntPtr.Zero) vProcess.Refresh();
        IntPtr vHandle = FindWindowEx(vProcess.MainWindowHandle,
            IntPtr.Zero, "Edit", null);
        SendMessage(vHandle, WM_SETTEXT, 0, "Zswang 路过");

    http://blog.csdn.net/zswang/article/details/1543956

  • 相关阅读:
    [转] Foobar2000 DSP音效外挂元件-Part4
    谷歌三件套
    Android 线刷小白教程
    nginx负载均衡
    HTTPS证书
    防火墙iptables
    LNMP架构部署
    tomcat部署
    shell编程
    HTTP协议
  • 原文地址:https://www.cnblogs.com/findumars/p/6347951.html
Copyright © 2011-2022 走看看