一个窗体调另一个另一个exe中的窗体

zyxfcb1520 2011-01-04 11:31:48
两窗体执行一样的动作
...全文
68 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wy811007 2011-01-04
  • 打赏
  • 举报
回复
用api 找窗体句柄 然后传参 告诉他要做什么。。
wuyq11 2011-01-04
  • 打赏
  • 举报
回复
findwidnow查找句柄
[DllImport ( "user32.dll", EntryPoint = "FindWindow", SetLastError = true )]
private static extern IntPtr FindWindow( string lpClassName, string lpWindowName );
[DllImport ( "user32.dll", EntryPoint = "FindWindowEx", SetLastError = true )]
private static extern IntPtr FindWindowEx( IntPtr hwndParent, uint hwndChildAfter, string lpszClass, string lpszWindow );
[DllImport ( "user32.dll", EntryPoint = "SendMessage", SetLastError = true, CharSet = CharSet.Auto )]
private static extern int SendMessage( IntPtr hwnd, uint wMsg, int wParam, int lParam );
[DllImport ( "user32.dll", EntryPoint = "SetForegroundWindow", SetLastError = true )]
private static extern void SetForegroundWindow( IntPtr hwnd )
const uint BM_CLICK = 0xF5;
IntPtr hwndCalc = FindWindow ( null, "" );
if ( hwndCalc != IntPtr.Zero )
{

}
hoken2020856 2011-01-04
  • 打赏
  • 举报
回复
用WCF吧,解决各种通信问题
freeboy827 2011-01-04
  • 打赏
  • 举报
回复
用API发送消息
ErrorCode1987 2011-01-04
  • 打赏
  • 举报
回复
查一下进程间通信的东西,相信很容易解决
GBY(google,baidu,yahoo)是你最好的老师~

110,569

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧