I have two applications, one is sending a message, one is receiving.
The sending app's code is as follows:
------------------------------------------------------------------------
private void Main()
{
Process p = Process.GetProcessesByName("MyApp")[0];
SendMessage(p.MainWindowHandle, 0xA123, IntPtr.Zero, IntPtr.Zero);
}
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
private static extern IntPtr SendMessage(IntPtr hwnd, uint Msg, IntPtr
wParam, IntPtr lParam);
------------------------------------------------------------------------
The code for the window receiving the message is as follows:
------------------------------------------------------------------------
protected override void WndProc(ref Message m)
{
if(m.Msg == 0xA123)
{
MessageBox.Show("Called");
}
base.WndProc(ref m);
}
....
this.ShowInTaskbar = false;
------------------------------------------------------------------------
Messages are not received when ShowTaskbar is set to false. Any ideas
on solving this issue?
Thx