mdi子窗口关闭时怎么触发父窗口的某一个函数?
解决方案 »
- 那里的问题?
- ActiveForm无法加载属性页
- 下载网站上的文件的一个小问题!100分!不够再加!
- 怎样禁止和解除 键盘 按键-------------在线等待!!!!
- [Warning] Unit3.pas(7): Unit 'FileCtrl' is specific to a platform 这是什么错误啊?
- 读取EXCEL文件时出错,请大家帮忙看看(附代码)。
- 谁有Delphi3的安装软件
- 简单问题,求教:Oracle 8.0.5中ParamByName的问题?
- delphi could not convert variant of type (null) into type (olestr)
- 好久没来了,正在写一本书。。。
- sendmessage怎么传送消息让另一个窗体执行自定义的某个函数呢?
- 求助 adotable 初始化的问题
百度 delphi wndproc
百度 delphi 自定义消息
---------------------------------------------------------------------------
子窗口所处BPL工程
---------------------------------------------------------------------------
Const
WM_MINE=WM_USER+100;
procedure TSysBaseBrowseForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
mainForm := FindWindow(nil,'test);
if mainForm = 0 then showError('没有找到!');//窗体是找到了的
Sendmessage(mainForm,WM_MINE,0,0);
end;
----------------------------------------------------------------------
主窗口所处BPL工程
-----------------------------------------------------------------------
Const
WM_MINE=WM_USER+100;
type .... private
procedure Mine(var msg:TMSG);message WM_MINE;
begin
ShowMessage('ddd');
end;
ddd就是没有弹出来?
其次可以试试RegisterWindowMessage这个函数注册一下,具体的查看MSDN
Sendmessage(main,WM_MINE,0,0);
Sendmessage(FindWindow(nil,pchar('test - ['+Caption+']')),WM_MINE,0,0);
知道问题出在哪了,前面看到别人BLOG上说FindWindow(nil,'test');<>0为找到窗体,但测试发现似乎并不是这样,
所以要发两条,
-------------------------------------------
Sendmessage(main,WM_MINE,0,0);再问下能否打此窗口的名称或其它东东做参数传进去?
(var msg: TMSG);这里的MSG怎么用呢?