日期:2014-05-18  浏览次数:20778 次

winform 消息传递
1.主程序需要调用一个托盘程序,怎么发消息过去
2.托盘程序需要给指定的主程序发消息
3.主程序有多份,托盘程序只有一个

环境: .net 2.0
开发语言:C#


谢谢大家!

------解决方案--------------------
重新描述一下。托盘程序是独立的么?和其他的有什么联系?是你写的么?
进程之间的通讯方式不止有消息,当然消息也可以。你先描述下。
------解决方案--------------------
都是你自己写的
就研究进程间通讯的问题就行了
不行你socket互相发信息然后接收解析也行

------解决方案--------------------
public const int GW_OWNER = 4;
public const int SW_HIDE = 0;

[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint="GetWindow")]
public static extern System.IntPtr GetWindow(System.IntPtr hWnd, uint uCmd) ;

[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint="ShowWindow")]
public static extern bool ShowWindow(System.IntPtr hWnd, int nCmdShow) ;

IntPtr h=GetWindow(this.Handler,GW_OWNER);
ShowWindow(h,SW_HIDE);


进程间通信
http://topic.csdn.net/u/20110114/18/3a5adf98-8475-40d9-bb6d-4f37f2fddd38.html
------解决方案--------------------
这个直接用UDP就可以了哎