G
Guest
Hi,
I want to post a windows message from one application and read it in another
application.
I am using the below code to post a message to a form but i am not able to
read the message in the receiving form in another application.
IntPtr hWnd;
hWnd = FindWindow(null, "MsgWindow");
int i = PostMessage(hWnd, 5000, 5000, 5000);
if (i == 0)
MessageBox.Show("Window not found!");
[DllImport("coredll.dll")]
public extern static int SendMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);
[DllImport("coredll.dll")]
public extern static int PostMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);
[DllImport("coredll.dll", EntryPoint = "FindWindowW", CharSet =
CharSet.Unicode)]
public static extern IntPtr FindWindow(String strClass, String strWindowName);
Can some one tell me how that can be done and any sample code showing how it
can be done.
Thanks,
Murthy
I want to post a windows message from one application and read it in another
application.
I am using the below code to post a message to a form but i am not able to
read the message in the receiving form in another application.
IntPtr hWnd;
hWnd = FindWindow(null, "MsgWindow");
int i = PostMessage(hWnd, 5000, 5000, 5000);
if (i == 0)
MessageBox.Show("Window not found!");
[DllImport("coredll.dll")]
public extern static int SendMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);
[DllImport("coredll.dll")]
public extern static int PostMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);
[DllImport("coredll.dll", EntryPoint = "FindWindowW", CharSet =
CharSet.Unicode)]
public static extern IntPtr FindWindow(String strClass, String strWindowName);
Can some one tell me how that can be done and any sample code showing how it
can be done.
Thanks,
Murthy