[轉貼收藏]兩個程序之間發送消息
来源:互联网 发布:长冈技术科学大 知乎 编辑:程序博客网 时间:2024/04/29 07:58
pb:
string ls_Classname,ls_WindowName
ulong ll_winhandle
uint li_result
setnull(ls_ClassName)
ls_WindowName ="Form1" //delphi程序窗口名称
ll_winhandle = findwindow(ls_ClassName,ls_WindowName)
if ll_winhandle>0 then //拨通
li_result = RegisterWindowMessage('1111') //注册系统消息,返回系统唯一消息号
post(ll_winhandle,li_result,0,0)
messagebox("提示","知道")
else
messagebox("提示","没有找到")
end if
======================================
delphi:
声明部分:
private
Msg: LongInt;
hWndC : THandle;
{ Private declarations }
protected
procedure WndProc(var Message: TMessage); override;
procedure TForm1.FormCreate(Sender: TObject);
begin
Msg := RegisterWindowMessage('1111');//返回系统唯一消息号,1111为自定义消息内容
Self.BringToFront;
end;
procedure TForm1.WndProc(var Message: TMessage);
var
mypt:Tpoint;
s:string;
begin
if Message.msg = msg then begin
ShowMessage(inttostr(message.lparam) );
end ;
inherited;
end;
- [轉貼收藏]兩個程序之間發送消息
- 程序收藏
- 调用现有程序的接口(分享),发送和保存消息; 卸载程序的代码收藏
- WINDOWS消息大全(收藏)
- 收藏.Windows.消息大全
- VCL消息(一) 收藏
- MFC消息解释收藏
- MFC消息偏--收藏
- 微信小程序之 PHP 发送模板消息
- [收藏]MD5算法之C#程序 MD5算法描述
- Windows消息分类,消息大全收藏
- Windows消息大全(收藏)
- 程序源码中新进收藏
- 实习程序收藏
- 心跳防护程序 收藏
- 适用的程序收藏
- 收藏个perl程序
- 程序开发-网址收藏
- JAVA的文章及资料
- 我们是这样出来接项目的
- 一套的实用完整Makefile参考模板
- English Web Sites
- 移动CMPP3.0解Deliver包(C#版)
- [轉貼收藏]兩個程序之間發送消息
- 软件创意
- 关于BCD码的编码和解码(C#版)
- C#中利用反射,动态生成类的实例
- J2EE 面试题综合
- 发布您的基于Eclipse的产品 选择自 smallnest 的 Blog
- 切·格瓦拉传奇战士
- CorelDraw认证考试样卷
- 西门子PPI协议的工控通信控件