Delphi ʹÓÃ×Ô¶¨ÒåÏûÏ¢
1¡¢ÏÈÓÃConst ¶¨ÒåÒ»¸ö³£Á¿£¬ÀýÈç const WM_MyMessage=WM_USER+$200;
2¡¢ÔÚҪʵÏÖµÄunitÖж¨ÒåÒ»¸ö˽Óз½·¨
procedure doMyMessage(var msg:TMessage);message WM_MyMessage;
3¡¢ÊµÏÖÕâ¸ö˽Óз½·¨
procedure TForm1.doMyMessage(var msg:TMessage);
begin
//
if msg.Msg= WM_MyMessage then
showmessage('ºÃ°¡')
else
showmessage('²»ºÃ');
end;
4¡¢×îÖØÒª °ÑÕâ¸öÏûÏ¢¹ã²¥³öÈ¥ Form1.Perform(WM_MyMessage,0,0);
ÏÂÃæÊÇʵÏֵĴúÂë
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
const WM_MyMessage=WM_USER+$200;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure doMyMessage(var msg:TMessage);message WM_MyMessage;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.doMyMessage(var msg:TMessage);
begin
//
if msg.Msg= WM_MyMessage then
showmessage('ºÃ°¡')
else
showmessage('²»ºÃ');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Perform(WM_MyMessage,0,0);
end;
end.
Ïà¹ØÎĵµ£º
ÓÃDelphi×÷µÄ³ÌÐòµÄÔ´´úÂëÖг£¼ûµÄÎļþÀ©Õ¹Ãû£¬²¢¸ø³öÁËÕâЩÎļþÀ©Õ¹ÃûµÄÒâÒ壬ÒÔ±ãÔ´´úÂë¹ÜÀíʱ×÷Ϊ²ÎÕÕ£¬À©Õ¹ÃûÒÔ×ÖĸΪÐò£¨²»ÐèÒª½øÔ´´úÂë¿â²»±íʾ²»ÐèÒª½ø¿â£©¡£
¡¡¡¡~*
¡¡¡¡DelphiÉú³ÉµÄ±¸·ÝÎļþ£¬ÔÚ°æ±¾¿ØÖÆ¿â¼°·¢²¼´úÂëÖв»Ó¦¸Ã³öÏÖÕâЩÎļþ£¬Èç¹ûÐÞ¸ÄÁËij¸öÎļþÈ´ÒòijЩÔÒòûÓб£´æµÄ»°£¬¿ÉÒÔ³¢ÊÔʹÓÃÕâЩÎļþ» ......
1¡¢ ϵͳ¹¦ÄÜ
1£©¡¢Êý¾ÝѹËõ
ʹÓÃDELPHIÌṩµÄÁ½¸öÁ÷ÀࣨTCompressionStreamºÍTDecompressionStream£©À´Íê³ÉÊý¾ÝµÄѹËõºÍ½âѹËõ¡£
2£©¡¢Êý¾Ý¼ÓÃÜѹËõ
ͨ¹ýDelphi±à³ÌÖГÁ÷”µÄÓ¦ÓÃʵÏÖÊý¾Ý¼ÓÃÜ£¬Ö÷Òª²ÉÓÃTstreamµÄÁ½¸öÅÉÉúÀàTfilestream¡¢Tmemorystream À´Íê³ÉµÄ£»ÆäÖÐÊý¾ÝѹËõ²¿·Ö²ÉÓÃ1£©µÄʵÏÖ· ......
Ãû³Æ ¡¡ ÀàÐÍ ¡¡¡¡¡¡ËµÃ÷
--------------------------------------------------------- ......
¼¼Êõ½»Á÷,DH½²½â. ×î½üºÍ·ÊÄñ½»Á÷ÁËϹØÓÚ×Ö·û´®·½ÃæµÄ֪ʶ,¶øÕâƪÎÄÕÂÊǺܾÃÒÔǰдµÄ,ÏÖÔÚ·¢³öÀ´°É. ÎÒÃÇдÁ½¶Î´úÂëÀ´¶Ô±ÈÏÂ:
µÚÒ»¸öÓÃCopyº¯Êý:
procedure TForm1.Button1Click(Sender: TObject);
var
a,c:Cardinal;
n:Integer;
D:Double;
i:Integer;
b:string;
begin
c:=0; ......