| 查看: 813 | 回复: 9 | |||
[交流]
【求助】连接两个软件 已有5人参与
|
| 用MFC编了个小软件 想和另外一个软件(MFC编)链接起来 比如点下按钮就链接到另一个软件 不知道能不能实现 怎么实现 |
» 猜你喜欢
Materials Today Chemistry审稿周期
已经有4人回复
萌生出自己或许不适合搞科研的想法,现在跑or等等看?
已经有3人回复
参与限项
已经有3人回复
假如你的研究生提出不合理要求
已经有7人回复
实验室接单子
已经有4人回复
全日制(定向)博士
已经有4人回复
对氯苯硼酸纯化
已经有3人回复
求助:我三月中下旬出站,青基依托单位怎么办?
已经有12人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复
» 本主题相关价值贴推荐,对您同样有帮助:
【版规】试题资源版管理规定【版规】
已经有1人回复
考研版版规
已经有45人回复
【求助】TCD测二氧化碳,为何一直是负峰?且一个波峰化为两半波峰
已经有11人回复
【求助】materials studio 软件中高分子材料模拟的力场选择
已经有10人回复
【求助】http://127.0.0.1:18888 打不开
已经有6人回复
一些网站无法打开,具体见贴说明……【谢谢】
已经有10人回复
【求助】DS中如何延长现有的DNA模型
已经有0人回复
【分享】巨牛总结:搞有机必须学会的合成检索方法
已经有169人回复
考研版版规
已经有127人回复
【求助】EndNote引用出现“文件未找到”的问题
已经有8人回复

2楼2010-11-04 16:39:36
3楼2010-11-04 16:51:33
holmescn
金虫 (正式写手)
- 程序强帖: 37
- 应助: 1 (幼儿园)
- 金币: 1918.8
- 散金: 275
- 红花: 1
- 帖子: 699
- 在线: 102.6小时
- 虫号: 913482
- 注册: 2009-11-26
- 性别: GG
- 专业: 凝聚态物性 II :电子结构
4楼2010-11-04 18:24:20

5楼2010-11-04 20:17:30
fzr417
木虫 (正式写手)
- 应助: 10 (幼儿园)
- 金币: 3523.7
- 散金: 10
- 帖子: 639
- 在线: 95.1小时
- 虫号: 573037
- 注册: 2008-06-13
- 性别: GG
- 专业: 计算机软件
★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ajian04(金币+2):谢谢参与交流~ 2010-11-04 21:55:53
小木虫(金币+0.5):给个红包,谢谢回帖交流
ajian04(金币+2):谢谢参与交流~ 2010-11-04 21:55:53
|
给你举个计算器的例子,你体会编写一下,就明白了 第一个VC按钮 WinExec("calc.exe", SW_SHOW); 这句是打开计算器,可以直接替换成你要打开的那个文件名,比如d盘下面的a.exe,应该这样写"D:\\a.exe",注意是双斜杠,此类函数比较多,你还可以用ShellExecute、CreateProcess或system,具体的每个函数的用法自己查一下MSDN吧,好运! 第二个VC按钮 HWND hWnd = ::FindWindow("SciCalc","计算器" ; 获得打开计算器的句柄,SciCalc可以由VC自带工具spy++来侦查,下面的0x83也是 HWND hButton = ::GetDlgItem(hWnd,0x83); 获得按钮的句柄,此处是获得计算器中7 ::SendMessage(hButton,WM_LBUTTONDOWN,MK_LBUTTON,NULL); 由按钮句柄发送消息按下鼠标左键消息 ::SendMessage(hButton,WM_LBUTTONUP,MK_LBUTTON,NULL); 由按钮句柄发送消息抬起鼠标左键消息 |
6楼2010-11-04 20:56:35

7楼2010-11-05 00:20:20

8楼2010-11-05 08:39:55
holmescn
金虫 (正式写手)
- 程序强帖: 37
- 应助: 1 (幼儿园)
- 金币: 1918.8
- 散金: 275
- 红花: 1
- 帖子: 699
- 在线: 102.6小时
- 虫号: 913482
- 注册: 2009-11-26
- 性别: GG
- 专业: 凝聚态物性 II :电子结构
9楼2010-11-05 11:37:22
★ ★ ★
小木虫(金币+0.5):给个红包,谢谢回帖交流
ajian04(金币+2):谢谢交流~ 2010-11-05 17:43:15
小木虫(金币+0.5):给个红包,谢谢回帖交流
ajian04(金币+2):谢谢交流~ 2010-11-05 17:43:15
|
不需要那么多控制权的时候,就可以用ShellExecute啊。 只是WinExec这个函数不要用了,因为MSDN里有注解: Note This function is provided only for compatibility with 16-bit Windows. Applications should use the CreateProcess function. 另外WinExec这个函数不安全: Security Remarks The executable name is treated as the first white space-delimited string in lpCmdLine. If the executable or path name has a space in it, there is a risk that a different executable could be run because of the way the function parses spaces. The following example is dangerous because the function will attempt to run "Program.exe", if it exists, instead of "MyApp.exe". WinExec("C:\\Program Files\\MyApp", ...) If a malicious user were to create an application called "Program.exe" on a system, any program that incorrectly calls WinExec using the Program Files directory will run this application instead of the intended application. To avoid this problem, use CreateProcess rather than WinExec. However, if you must use WinExec for legacy reasons, make sure the application name is enclosed in quotation marks as shown in the example below. WinExec("\"C:\\Program Files\\MyApp.exe\" -L -S", ...) |

10楼2010-11-05 14:31:12












回复此楼
;