delphi RM¸ñʽµÄ²¥·ÅÆ÷µÄ¼¼ÇÉ
Ëæ×ÅÍøÂçµÄÈÕÒæÆÕ¼°£¬RM£¨Real Media£©¸ñʽµÄ¶àýÌåÎļþÓÉÓÚѹËõ±È¸ß¶øÊܵ½ÊÀ½ç·¶Î§µÄÈÏͬºÍ»¶Ó¡£°²×°ÍêRealPlayerÖ®ºó£¬ÏµÍ³Öн«»á±»¼ÓÈëÒ»¸ö²¥·ÅRM¸ñʽµÄActiveX¿Ø¼þ£¬ÎÒÃǾÍÊÇÀûÓÃÕâ¸ö¿Ø¼þÀ´ÊµÏÖRM¸ñʽÎļþµÄ²¥·Å¡£
1¡¢°²×°ActiveX¿Ø¼þ
µã»÷Component²Ëµ¥ÏµÄImport ActiveX ControlÑ¡Ï¾Í»á³öÏÖÒ»¸öÏÖÔÚ¿É°²×°µÄ¿Ø¼þÁÐ±í£¬Èç¹ûÄãÒѾ°²×°ÁËRealPlayerµÄ»°£¬Ñ¡ÖÐRealPlayer ActiveX Control LibrarryÈ»ºó°´Install¼ü¼´¿É ¡£ÔÚ³öÏÖÁËÐí¶àÈ·ÈÏÐÅÏ¢Ö®ºó£¬Ò»¸öÃûΪRealAudioµÄActiveX¿Ø¼þ¾Í×°ÈëÁËÄãµÄDelphiÖ®ÖС£
2¡¢Ñ§Ï°¿Ø¼þµÄʹÓÃ
´ò¿ªÄ¿Â¼\Delphi5\Imports\£¬ÕÒµ½RealAudioObjects_TLB.pasÎļþ²¢´ò¿ª£¬ÕâÀïÃæ°üº¬Á˿ؼþÈ«²¿µÄ²Ù×÷º¯Êý¡¢¹ý³Ì¼°ÊôÐÔ¡£ÒÔÏÂÊǶԼ¸¸ö³£Óõĺ¯ÊýºÍ¹ý³ÌµÄ¼òÒª½éÉÜ£º
SetSource£¨Îļþ·¾¶£©£ºÉèÖÃË÷Òª²¥·ÅµÄÎļþµÄÍêÕû·¾¶£»
DoPlay£º²¥·Å£»
DoPlayPause£ºÔÝÍ££»
DoStop£ºÍ£Ö¹£»
SetControls£¨£©£ºÉèÖò¥·ÅÃæ°åÏÔʾÇé¿ö£¬¾ßÌåµÄʹÓ÷½·¨ºóÃæ½éÉÜ£»
SetFullScreen£ºÉèÖÃÈ«ÆÁ²¥·Å£»
SetMute£¨True\False£©£ºÉèÖþ²Òô£»
ÆäËû¹¦ÄÜÏê¼ûRealAudioObjects_TLB.pas¡£
3¡¢²¥·ÅÆ÷µÄÖÆ×÷
µã»÷File\New Application£¬´´½¨Ò»¸öеĴ°Ì壻
ÔÚ´°ÌåÉϼÓÔØRealAudio¿Ø¼þ£¬ÉèÖÃÊôÐÔVisableΪFalse£»
ÔÚ´°ÌåÉÏÔÙ·Ö±ð¼ÓÉÏOpenDialog¿Ø¼þºÍ5¸öButton¿Ø¼þ£¬²¢ÉèÖÃButton¿Ø¼þµÄCaptionÊôÐÔ·Ö±ðΪ“´ò¿ª”¡¢“²¥·Å”¡¢“ÔÝÍ£”¡¢“Í£Ö¹”¡¢“È«ÆÁ”£»£¨¼û¸½Í¼1£©
ÊäÈëÈçÏ´úÂ룺
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, OleCtrls, RealAudioObjects_TLB;
type
TForm1 = class(TForm)
RealAudio1: TRealAudio;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
OpenDialog1: TOpenDialog;
Button5: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Send
Ïà¹ØÎĵµ£º
¹«Ë¾µÄ²ÍÒûϵͳ³öÆ·µÄÖú¼ÇÂ룬»¹Ã»ÊµÏÖ×Ô¶¯´Ó³öÆ·Ãû³Æ»ñÈ¡ºº×ÖÆ´ÒôÊ××Öĸ¡£
ËùÒÔÔÚÍøÉÏÕÒÁËÈýÖÖ½â¾ö·½·¨£¬
Ò»ÖÖÊÇkaguo µÄʹÓó£Óúº×ÖÆ´Òô²éÕÒ·½·¨£¬ÕâÖÖ´úÂëÊ®·Ö¼òµ¥£¬ÊµÏÖ·½±ã£¬µ«ÊÇÕâÖÖ´úÂë½ö½öÊÇÒ»¼¶×ֿ⣬ֻ֧³ÖÈýǧÁ㼸¸ö×ֵġ£
//»ñÈ¡ÖÐÎÄ×Ö´®µÄÉùĸµ ......
ÔÚȺÀï¿´µ½ÓÐÈË·¢Á˸ö±ðÈË·¢¸øËûµÄ
ÎÒ¿´ÁËдµÄ±È½ÏÉú¶¯ ÔÚÕâת¸ø´ó¼Ò¿´¿´
ºÃµÄ Ê°È¡ÎïÌ庯ÊýдºÃÁË Ï²½ÊÇÈçºÎ½«´úÂë×¢Èëµ½ÓÎÏ·½ø³ÌÖÐÖ´ÐÐ??
1) С͵¿ªÃÅ
PHND:= OpenProcess (PROCESS_ALL_ACCESS, False, PID);µÃµ½ÓÎÏ·´°¿Ú¾ä±ú»ñµÃȨÏÞ
2)С͵ÔÚ·¿¼ä¸ã¸ö·Å×÷°¸·½°¸µÄµØ·½
TAdd := VirtualAllocEx(PHND, nil, 4096, ......
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
&n ......
interface
uses Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, StdCtrls, Buttons;
type
TDemoForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
GetButton: TBitBtn;
CloseButton: TBitBtn;
Bevel1: TBevel;
Label5: TLabel;
......
ÔÚDelphiÖУ¬Í¨³£¿ÉÒÔÓÃÒÔÏÂÈýÖÖ·½·¨À´ÊµÏÖ³ÌÐòµÄÑÓʱ£¬¼´TTtimer¿Ø¼þ£¬Sleepº¯Êý£¬GetTickCountº¯Êý¡£µ«ÊÇÆ侫¶ÈÊǸ÷²»ÏàͬµÄ¡£
Ò»¡¢ÈýÖÖ·½·¨µÄ¼òµ¥½éÉÜ
1£©TTtimer¿Ø¼þ
¡¡¡¡TTtimer¿Ø¼þµÄʵÖÊÊǵ÷ÓÃWindows API¶¨Ê±º¯ÊýSetTimerºÍKillTimerÀ´ÊµÏֵģ¬²¢¼ò»¯Á˶ÔWM_TIMER ÏûÏ¢µÄ´¦Àí¹ý³Ì¡£Í¨¹ýÉèÖÃOnTimerÊÂ
¼þºÍInte ......