I'd like to control menus on a apps created by myself.
Apps A.exe:
Windows Form apps (C#)
It has menus
Menu1-MenuItem1(MenuItem of Menu1)
MenuItem1 calls a EventHandler that shows a message box
Apps B.exe:
Windows Form apps (C#)
It has a button
If I click the button, I'd like to launch A and select Menu1-MenuItem1.
I can launch A by
System.Diagnostics.Process.Start("A.exe");
But I'm not sure how can I click the MenuItem1 from B.
I saw some web sites, and SendMessage seems to be a method I can use.
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern int SendMessage (IntPtr hwnd, int wMsg, int wParam, int lParam);
But I'm not sure what value should be set for wMsg, int wParam, int lParam for my case.
Could you please answer it?
Thank you in advance.