unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, shellAPI, StrUtils, StdCtrls;
const
TempHumid=WM_USER+61021;
type
TForm1 = class(TForm)
Label3: TLabel;
Label4: TLabel;
Label1: TLabel;
Label2: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure HandleMessage(var msg: TagMsg;var handled: Boolean); //message TempHumid;
public
{ Public declarations }
end;var
Form1: TForm1;
// TempHumid:UINT;
implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := HandleMessage;
// shellexecute(application.Handle,nil,'.\HumidServer.exe',nil,nil,sw_shownormal)
end;procedure TForm1.HandleMessage(var msg: TagMsg;var handled: Boolean);
var
temp: double;
begin
if Msg.message = TempHumid then
begin
label1.Caption:= inttostr(Msg.wParam);
temp:= Msg.lParam/10;
label2.Caption:= floattostr(temp);
end;
end;end.label1和label2是怎么算出来的,
这是一个接收 HumidServer.exe发来消息的程序,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, shellAPI, StrUtils, StdCtrls;
const
TempHumid=WM_USER+61021;
type
TForm1 = class(TForm)
Label3: TLabel;
Label4: TLabel;
Label1: TLabel;
Label2: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure HandleMessage(var msg: TagMsg;var handled: Boolean); //message TempHumid;
public
{ Public declarations }
end;var
Form1: TForm1;
// TempHumid:UINT;
implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMessage := HandleMessage;
// shellexecute(application.Handle,nil,'.\HumidServer.exe',nil,nil,sw_shownormal)
end;procedure TForm1.HandleMessage(var msg: TagMsg;var handled: Boolean);
var
temp: double;
begin
if Msg.message = TempHumid then
begin
label1.Caption:= inttostr(Msg.wParam);
temp:= Msg.lParam/10;
label2.Caption:= floattostr(temp);
end;
end;end.label1和label2是怎么算出来的,
这是一个接收 HumidServer.exe发来消息的程序,
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货