delphi里听说可以利用NetMessageBufferSend发局域网内的用户消息,那怎么接收消息 delphi里听说可以利用NetMessageBufferSend发局域网内的用户消息,那怎么接收消息??????? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 要想接收该消息,只要打开系统messendger服务就可以接收。如果想在自己的程序里接收该消息,需要使用Hook,Hook所有的弹出窗体,根据弹出窗体的标题进行判断。然后获取里面的内容,再将窗体关闭。 楼上的怎么搞呢????unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;type NET_API_STATUS = LongInt; function NetMessageBufferSend(servername: LPCWSTR; msgname: LPCWSTR; fromname: LPCWSTR; buf: Pointer; buflen: DWORD): NET_API_STATUS; stdcall;external 'netapi32.dll';type TForm1 = class(TForm) Edit1: TEdit; Label1: TLabel; Label2: TLabel; Edit2: TEdit; Button1: TButton; procedure Button1Click(Sender: TObject);private { Private declarations }public{ Public declarations }end;var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject);var WideMsg:PWideChar; DestName:PWideChar;begin DestName:=PWideChar(WideString(Edit1.Text)); WideMsg:=PWideChar(WideString(Edit2.Text)); NetMessageBufferSend(nil,DestName,nil,WideMsg,Length(Edit2.Text)*2);end;end. 这段代码 编译不过去 我有把那个dll文件放在该工程目录下编译错误提示什么 非法字符之类 的再问一下,怎么Hook,自己才能收到消息??????? "非法字符之类",你是从网上COPY下来的吧?代码中有中文字符,可能你没看到,你把代码自己重新输入一遍,肯定可以编译通过的。Hook所有的窗口创建,发现有标题为"信使服务 "的窗口,获取其中的Static中的内容就是消息内容。如果你还不懂的话,你上网搜索吧。这个问题不是一两句就可以说的清楚的。 新增一窗体,程序启动后,同时弹出登录窗口跟新增的窗体,怎么办呀? 代码实现AdoQuery字段编辑器中Add All Fields功能 一段sql的程序出错,请高手指教 怎么把一个文本文件中的数据添加到一个数据库中? Access数据库加密码后怎么用ADO连接?(没加前连接是好的) 有关使用BDE连接SQL SERVER的问题 新问题,在DELPHI中怎样保持现场 请大家提供一点思路,一定给分,说话算话 对Jpg文件的不兼容 考考高手:如何获得正在运行的任意进程的application title? 求类似 播音王 一样的软件源码 帮忙翻译代码
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;
type
NET_API_STATUS = LongInt;
function NetMessageBufferSend(servername: LPCWSTR; msgname: LPCWSTR;
fromname: LPCWSTR; buf: Pointer;
buflen: DWORD): NET_API_STATUS;
stdcall;external 'netapi32.dll';
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit2: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
WideMsg:PWideChar;
DestName:PWideChar;
begin
DestName:=PWideChar(WideString(Edit1.Text));
WideMsg:=PWideChar(WideString(Edit2.Text));
NetMessageBufferSend(nil,DestName,nil,WideMsg,Length(Edit2.Text)*2);
end;
end. 这段代码 编译不过去 我有把那个dll文件放在该工程目录下编译错误提示什么 非法字符之类 的再问一下,怎么Hook,自己才能收到消息???????