cygwin[1.5.24(0.156/4/2)] インストール

cygwin[1.5.24(0.156/4/2)] インストール



  ・www.cygwin.com を開いて、[install now!] をクリック。
  ・そのままデフォルトでインストール
  ・インストール終了。



C# 他アプリへSendMessage



public partial class Form1 : Form

{

    #region User32.dll functions



    [DllImport("user32.dll", CharSet = CharSet.Auto)]

    public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);



    [DllImport("user32.dll",CharSet = CharSet.Auto)]

    static extern IntPtr FindWindow(string lpClassName,string lpWindowName);



    #endregion



    public Form1()

    {

        InitializeComponent();

        this.Text = Application.ProductName;

    }



    private void button1_Click(object sender, EventArgs e)

    {

        try

        {

            IntPtr hWnd = FindWindow(nullthis.txtApp.Text);

            

            if (hWnd != (IntPtr)0)

            {

                IntPtr lparam;

                SendMessage*1;

        }

    }

*1:System.IntPtr)hWnd, Convert.ToInt32(this.txtMsg.Text,16), 100);
            } 
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.ToString(