我是想问,怎么给他发字符串,
因为响应这个消息的(application.onmessage)的过程中要用到这个字符串。
因为响应这个消息的(application.onmessage)的过程中要用到这个字符串。
解决方案 »
- delphi面向对象编程问题
- alter增加currency字段
- 自己落伍了...
- 怎样在DBGrid里给某一列(如第三列,仅一列)的第二行到第六行网格绘上绿色背景,因为我想一步操作实现复制\粘贴多个网格的数据,数据库为Access 2000数据库(Delphi7),我对此已花很多时间和精力,敬请热心的高人指点,万分感谢!
- 关于DELPHI的控件问题
- 招聘DELPHI程序员
- [散分贴]散分是件有意义的事情[6:30结]
- 哪位高手知道?!!!
- 动态加载DLL异常!
- 急急急,高分寻求图片控件
- TO Musicwind 你到底是不是程序员????????
- 在WINDOWS2000下如何隐藏在进程列表中的进程?
delphi帮助中有个例子
const
WM_FILEREADY = WM_USER + 2000;
procedure TForm1.FormCreate(Sender: TObject);begin
Application.OnMessage := AppMessage;
end;procedure TForm1.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
if Msg.message = WM_FILEREADY then
begin
Memo1.Lines.LoadFromFile(StrPas(PChar(Msg.lParam)));
Handled := True; end; { for all other messages, Handled remains False }
{ so that other message handlers can respond }
end;
但不知道发消息时他的lparam怎么设的
看我的.sendmessage(yourhandle,WM_SETTEXT,0,laparam(pchar(youstring)));
之所以用WM_SETTEXT,因为我试过用自定义的消息好像指针不能正确传递.
大家再试试吧.
var
str:string;
s:^string;
s:=@str;SendMessage(你的handle,消息,wparam,integer(s))
收到消息后
在用
s:=lparam;
则S^就是字符串的内容