示例#1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            IntPtr handle1 = Classpub.FindWindow(null, "MessageBox1111");

            if (handle1 != IntPtr.Zero)
            {
                Classpub.PostMessage(handle1, Classpub.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
                //MessageBox.Show("MessageBox");
            }
        }
示例#2
0
        private void button6_Click(object sender, EventArgs e)
        {
            IntPtr handle1 = Classpub.FindWindow(null, "chuangkou2");

            if (handle1 != IntPtr.Zero)
            {
                Classpub.SendMessage(handle1, Classpub.WM_CLOSE, 0, 0);
                //MessageBox.Show("chuangkou2", "MessageBox1111");
                //MessageBox.Show("sendmessage 这里是跟随运行的窗口", "窗口");
            }
        }
示例#3
0
        private void button5_Click(object sender, EventArgs e)
        {
            IntPtr handle1 = Classpub.FindWindow(null, "chuangkou1");

            if (handle1 != IntPtr.Zero)
            {
                Classpub.PostMessage(handle1, Classpub.WM_CLOSE, IntPtr.Zero, IntPtr.Zero);
                //MessageBox.Show("chuangkou1", "MessageBox1111");
                //MessageBox.Show("postmessage 这里是跟随运行的窗口", "窗口");
            }
        }