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);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//ÿ¸öºº×ÖµÄÊ××Öĸ
function GetPyChar(const HZ: AnsiString): string;
const
HZCode: array[0..25, 0..1] of Integer = ((1601, 1636), (1637, 1832), (1833, 2077),
(2078, 2273), (2274, 2301), (2302, 2432), (2433, 2593), (2594, 2786), (9999, 0000),
(2787, 3105), (3106, 3211), (3212, 3471), (3472, 3634), (3635, 3722), (3723, 3729),
(3730, 3857), (3858, 4026), (4027, 4085), (4086, 4389), (4390, 4557), (9999, 0000),
(9999, 0000), (4558, 4683), (4684, 4924), (4925, 5248), (5249, 5589));
var
i,j,HzOrd: Integer;
begin
i := 1;
while i <= Length(HZ) do
begin
if (HZ[i] >= #160) and (HZ[i + 1] >= #160) then
begin
HzOrd := (Ord(HZ[i]) - 160) * 100 + Ord(HZ[i + 1]) - 160;
for j := 0 to 25 do
begin
if (HzOrd >= HZCode[j][0]) and (HzOrd <= HZCode[j][1]) then
begin
Result := Result + Char(Byte('A') + j);
Break;
end;
end;
Inc(i);
end else Result := Result + HZ[i];
Inc(i);
end;
²éÕÒÁíÍâÒ»¸ö´°¿ÚµÄ¾ä±ú£º handle := FindWindow(nil,PChar('´°¿ÚµÄ±êÌâ'));//²éµ½´°Ìå¾ä±ú
²éÕÒ×Ó´°Ì壺childHandle := FindWindowEx(handle,0,'×Ó´°ÌåÀà','×Ó´°Ìå±êÌâ');
ÁíÍâÓиöö¾Ù×Ó´°ÌåµÄAPI£¬EnumChildWindows(Ö÷´´Ìå¾ä±ú,@»Øµ÷º¯Êý,Óû§²ÎÊý);
ÓÃÕâ¸öº¯ÊýÐèÒª×Ô¼ºÐ´Ò»¸ö»Øµ÷µÄº¯Êý£¬±ÈÈ磺
function EnumChil ......
1. ×Ö·û´®Á¬½ÓÖ±½ÓÓÃ+£¬ÓëJavaºÍPythonÖеÄÏàͬ
2. Ö´ÐÐÍⲿÃüÁîʹÓÃwinexec£¬ShellExecute
eg. ShellExecute(0, 'open', 'jre/bin/java', '-lang zh-CN', 'E:\myfolder', SW_SHOW);
3. ÅжÏÎļþ¡¢Îļþ¼ÐÊÇ·ñ´æÔÚ
FileExists('C:\Users\bill\somefile.txt')
......
ȷʵºÜÓÐÓ㬵«ÊÇÕâ¸öÔõô°Ñ¿Õ¸ñҲĬÈÏΪ·Ö¸î·ûÁËÄØ£¬ËÖªµÀÔõÑù°Ñ¿Õ¸ñ²»ÈÏΪÊÇ·Ö¸î·ûµÄ£¿£¿ TStringsÊÇÒ»¸ö³éÏóÀ࣬ÔÚʵ¼Ê¿ª·¢ÖУ¬ÊdzýÁË»ù±¾ÀàÐÍÍ⣬ӦÓõÃ×î¶àµÄ¡£ ³£¹æµÄÓ÷¨´ó¼Ò¶¼ÖªµÀ£¬ÏÖÔÚÀ´ÌÖÂÛËüµÄһЩ¸ß¼¶µÄÓ÷¨¡£ ÏȰÑÒªÌÖÂ۵öÊôÐÔÁгöÀ´£º 1
ȷʵºÜÓÐÓ㬵«ÊÇÕâ¸öÔõô°Ñ¿Õ¸ñҲĬÈÏΪ·Ö¸î·ûÁËÄØ£¬ËÖªµÀÔõÑ ......