private void button2_Click(object sender, EventArgs e) { string caption = "DemoAdapter of GC Gateway"; AdapterMessage am = new AdapterMessage(4, AdapterStatus.Stopped); am.PostMessage(caption); }
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."); } } }
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); }