相关资料:

http://blog.csdn.net/yanjiaye520/article/details/7590252

注意事项:

1.ParamStr(0)是实例自己。

2.传的参数是以空格分看的。

3.“‘2 Hello World”,ParamStr(1) = '2' ;

发送窗体:

 unit Unit1;

 interface

 uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, ShellAPI, Vcl.StdCtrls; type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public { Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(Handle, 'open','project2.exe','2 Hello World',nil,SW_SHOWNORMAL);
end; end.

接收窗体:

 unit Unit1;

 interface

 uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type
TForm1 = class(TForm)
ListBox1: TListBox;
Label1: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end; var
Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject);
begin
//ParamStr(0)是实例自己,所以参数从1开始;而且传的参数是以空格分看的,“‘2 Hello World”,ParamStr(1) = '2' 了;
ListBox1.Items.Add(ParamStr());
end; end.

PS:如果使用CreateProcess建进程,怎么发参数呢?

     if not IsBuildInFit then
begin //不代参数
bActiveState := CreateProcess(PChar(nil), PChar(GetExePath + sHardWareName), @lpsaProcess,
@lpsaThread, false, CREATE_SHARED_WOW_VDM, PChar(nil), PChar(nil),
lpsiStartInfo, oProcInfo);
end
else
begin //代参数
bActiveState := CreateProcess(PChar(nil), PChar(GetExePath + sHardWareName + ' True'), @lpsaProcess,
@lpsaThread, false, CREATE_SHARED_WOW_VDM, PChar(nil), PChar(nil),
lpsiStartInfo, oProcInfo);
end;

启动程序的同时传参给接收程序(XE8+WIN764)的更多相关文章

  1. asp.net Get和Post传参和接收参数

    asp.netGet和Post传参和接收参数 Get请求: 对于传参:test.aspx?name=%e5%bc%a0%e4%b8%89 接收参数的方法: Request.QueryString[&q ...

  2. (SSM框架)实现小程序图片上传(配小程序源码)

    阅读本文约"2分钟" 又是一个开源小组件啦! 因为刚好做到这个小功能,所以就整理了一下,针对微信小程序的图片(文件)上传! 原业务是针对用户反馈的图片上传.(没错,本次还提供小程序 ...

  3. 微信小程序页面返回传参的问题

    比如提交问题,然后需要返回之前页面,由于onLoad只会加载一次,所以不会触发,但是我们页面又需要刷新,那怎么办? 1.onLoad与onShow区别 onLoad:监听页面加载.一个页面只会调用一次 ...

  4. js传参java接收乱码解决方案

    js传参处理 encodeURI(encodeURI(name)); java接收处理 URLDecoder.decode(request.getParameter("name") ...

  5. vue 路由传参 、接收参数

    传参组件 一. <router-link :to='"/main/course?navName=" +item.columnName + "&id=&quo ...

  6. jsp传参 servlet接收中文乱码问题

    在公司实习了8个月,一直都是做android和h5的,但是发现做程序连一点服务都不会该怎么办,所以最近开始学起了java,不知道是不是因为框架学多了,现在看起springmvc框架比以前看起来简单太多 ...

  7. 微信小程序跳转传参参数丢失?

    垂死病中惊坐起,笑问 Bug 何处来?! 1.先是大写字母作祟 前两天发布了「柒留言」v2.0.0 新版本,结果...你懂的嘛,没有 Bug 的程序不是好程序,写不出 Bug 的程序员不是好程序员. ...

  8. RestTemplate post请求使用map传参 Controller 接收不到值的解决方案 postForObject方法源码解析.md

    结论 post方法中如果使用map传参,需要使用MultiValueMap来传递 RestTemplate 的 postForObject 方法有四个参数 String url => 顾名思义 ...

  9. vue-router query和params 传参和接收参数

    1.params 方式传递和接收参数 //传参 this.$router.push({ name: 'checkDetailInfo', params:{ fkdNum:fkdNum, jyayStr ...

随机推荐

  1. 内核MKDEV(MAJOR, MINOR)宏

    版本:linux-2.6.24.4宏:    MKDEV(MAJOR, MINOR);  说明: 获取设备在设备表中的位置.        MAJOR   主设备号        MINOR   次设 ...

  2. ifdebug

    #if DEBUG 首先,大小写不能写错. 其次,解决方案配置设为:Debug,才会执行该语句,如果在条件里面搭配Debug.Assert等,效果甚佳.而如果要设置为Release模式,就不会执行条件 ...

  3. linq to Entity 数据库除了有主键还有唯一索引,是不是不能更新

    数据库建了一个唯一索引,使用linq to ef更新的时候,老是报,索引建冲突,,坑了我一上午,最后把索引删了

  4. textbox不支持Ctrl+A

    http://stackoverflow.com/questions/5885739/why-are-some-textboxes-not-accepting-control-a-shortcut-t ...

  5. MemSQL Start[c]UP 2.0 - Round 1 B. 4-point polyline (线段的 枚举)

    昨天cf做的不好,居然挂零了,还是1点开始的呢.,,, a题少了一个条件,没判断长度. 写一下B题吧 题目链接 题意: 给出(n, m),可以得到一个矩形 让你依次连接矩形内的4个点使它们的长度和最长 ...

  6. ASP.NET MVC 学习6、学习使用Code First Migrations功能,把Model的更新同步到DB中

     参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-new-field-to-th ...

  7. 解析CSS加密技术之“障眼法”

    CSS(Cascading Style Sheet,可译为“层叠样式表”或“级联样式表”)是一组格式设置规则,用于控制Web页面的外观.通过使用CSS样式设置页面的格式,可将页面的内容与表现形式分离. ...

  8. Jquery 模板插件 jquery.tmpl.js 的使用方法(1):基本语法,绑定,each循环,ajax获取json数据

    jquery.tmpl.js 是一个模板js  ,主要有2个方法 (1):$.template()方法,将一段script或者是Html编译为模板,例如 $.template('myTemplate' ...

  9. 实现一个简单的FTP服务器(十四)

    此为一个网络编程的一个系列,后续会把内容补上...

  10. Azure SQL 数据库最新版本现已提供预览版

     Tiffany Wissner  数据平台营销高级总监 我们之前在11月宣布将提供新的预览版,在该预览版中我们引入了接近完整的 SQL Server 引擎兼容性和更为高级的性能,这些都代表了下一代的 ...