Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            string         caption = "DemoAdapter of GC Gateway";
            AdapterMessage am      = new AdapterMessage(4, AdapterStatus.Stopped);

            am.PostMessage(caption);
        }
Exemple #2
0
        public void NotifyServiceStop()
        {
            if (Enable && amStopped != null)
            {
                //int hwnd = Win32Api.FindWindow(null, windowCaption);
                //Program.Log.Write(hwnd.ToString() + " - " + windowCaption);

                if (amStopped.PostMessage(windowCaption))
                {
                    Program.Log.Write("Messager posts stopping message succeeded.");
                }
                else
                {
                    Program.Log.Write(LogType.Warning, "Messager posts stopping message failed.");
                }
            }
        }
Exemple #3
0
        private void buttonCallme_Click(object sender, EventArgs e)
        {
            string caption = "DemoAdapter of GC Gateway";
            //string caption = "HYS Interface Engine Manager";
            ////string className = "WindowsForms10.Window.8.app.0.3b95145";
            //int hwnd = Win32Api.FindWindow(null, caption);
            ////int hwnd = Win32Api.FindWindow(className, null);

            //// use caption after all...

            //IntPtr h = this.Handle;
            //IntPtr i = (IntPtr)hwnd;
            //MessageBox.Show(i.ToString()+" " + h.ToString());

            //Win32Api.PostMessage(i, MsgID, 1, 2);
            ////Win32Api.SendMessage(i, MsgID, (IntPtr)1, "2");

            AdapterMessage am = new AdapterMessage(123, AdapterStatus.Stopped);

            am.PostMessage(caption);
        }