DelphiµÄHashTable
{-----------------------------------------------------------------------------
Unit Name: HashTable
Author: LiuHeng
Date: 2010-04-13
Purpose: ·â×°DelphiµÄHashTable
History:
-----------------------------------------------------------------------------}
unit HashTable;
interface
uses
Classes,IniFiles;
type
THashTable = class(THashedStringList)
public
procedure AddStrItem(const ItemName: string;const ItemValue: string);
function ObjectValue(const ObjName: string): TObject;
end;
implementation
{ THashTable }
procedure THashTable.AddStrItem(const ItemName: string;const ItemValue: string);
begin
Add(ItemName+'='+ItemValue);
end;
function THashTable.ObjectValue(const ObjName: string): TObject;
var
AIndex: integer;
begin
Find(ObjName,AIndex);
if AIndex>=0 then
Result := Objects[AIndex];
end;
end.
Ïà¹ØÎĵµ£º
Delphi UÅ̲åÈ벦³ö¼ì²â£º
1¡¢Ð½¨¹¤³Ì£»
2¡¢ÔÚform1ÉÏ·ÅÒ»¸öLabel£»
3¡¢¶¨ÒåÒ»¸ö˽Óйý³Ì
procedure WMDeviceChange(var Msg: TMessage); message WM_DEVICECHANGE;
ÍêÕû´úÂëÈçÏ£º
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics ......
Îҵİ취£¬Ôö¼ÓÒ»¸ötimer ÉèÖüä¸ô100ms£¬Í¨¹ýtimerµÄʹÄÜ·ñ£¬¿ØÖƱ¨¾¯ÉùÒô¿ª¹Ø
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Windows.Beep(1200+i_f,10+i_f);
if i_f<2000 then
begin
inc(i_f);
end
end;
== ......
ÉÏһƪ£¬½éÉÜÁË×é¼þ¿ª·¢µÄÒ»°ã¸ÅÊö£¬ÒÔ¼°×é¼þÀà²ã´Î½á¹¹µÄ¸÷¸öÀàµÄ´óÖÂÐÅÏ¢£¡ÏÖÔھͿªÊ¼Í¨¹ýʵÀý½øÐÐÀ´¼òµ¥µÄ½²ÊöÒ»ÏÂÒ»°ã×é¼þµÄ¿ª·¢¹ý³Ì£¡ÎÒÕâÀïÏȲÉÓÃ×î
»ù±¾µÄ·½Ê½À´´´½¨Ò»¸ö×é¼þ£¡Ò²¾ÍÊÇʹÓÃDelphi×Ô¼ºµÄ×é¼þ¿ª·¢Ïòµ¼À´½¨Á¢Ò»¸öеÄ×é¼þ¡£ÔÚÕâÀÎÒÒÔÀ©³äTEditΪÀý½øÐн²½â¡£
ÄÇôÊ×ÏÈ£¬Òª½éÉܵľÍÊÇ ......
Delphi ÖÐ FindWindow ºÍ FindWindowEx µÄÓï·¨ºÍÓ÷¨
FindWindow(
lpClassName, {´°¿ÚµÄÀàÃû}
lpWindowName: PChar {´°¿ÚµÄ±êÌâ}
): HWND; {·µ»Ø´°¿ÚµÄ¾ä±ú; ʧ°Ü·µ»Ø 0}
//FindWin ......
Èç½ñRealPlayerµÄÁ÷ʽýÌåÎļþÒÔÆäÇ¿´óµÄÊÓÆµÑ¹Ëõ±ÈÕýÖð²½ÇÄÈ»ÐËÆð¡£RealPlayer Plus²¥·ÅÆ÷Ò²ÀíËùµ±È»µØ³ÉΪ´ó¼Ò²¥·ÅRealPlayer¸ñʽÎļþµÄÊ×Ñ¡Èí¼þ¡£²»¹ýRealPlayer PlusÒ²²»ÊÇʮȫʮÃÀµÄ£¬±ÈÈçÆô¶¯Ê±¼äÂý£¬Õ¼Óÿռä´ó£¬ÁôÓÐÀúÊ·¼Ç¼µÈµÈ¡£ÆäʵÎÒÃÇ¿ÉÒÔÀûÓÃDelphi´òÔìÒ»¸öÍêÈ«·ûºÏ×Ô¼ºÒªÇóµÄRealPlayer² ......