亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? apputils.pas

?? RX Library contains a large number of components, objects and routines for Borland Delphi with full
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
{*******************************************************}
{                                                       }
{         Delphi VCL Extensions (RX)                    }
{                                                       }
{         Copyright (c) 1995, 1996 AO ROSNO             }
{         Copyright (c) 1997, 1998 Master-Bank          }
{                                                       }
{*******************************************************}

unit AppUtils;

interface

{$I RX.INC}

uses Windows, Registry, RTLConsts, Classes, Controls, Forms, IniFiles, Grids, VCLUtils;

function GetDefaultSection(Component: TComponent): string;
procedure GetDefaultIniData(Control: TControl; var IniFileName,
  Section: string {$IFDEF WIN32}; UseRegistry: Boolean {$ENDIF});
function GetDefaultIniName: string;

type
  TOnGetDefaultIniName = function: string;

const
  OnGetDefaultIniName: TOnGetDefaultIniName = nil;

{$IFDEF WIN32}
var
  DefCompanyName: string = '';
  RegUseAppTitle: Boolean = False;

function GetDefaultIniRegKey: string;
{$ENDIF}

function FindForm(FormClass: TFormClass): TForm;
function FindShowForm(FormClass: TFormClass; const Caption: string): TForm;
function ShowDialog(FormClass: TFormClass): Boolean;
function InstantiateForm(FormClass: TFormClass; var Reference): TForm;

{$IFDEF WIN32}
procedure SaveFormPlacement(Form: TForm; const IniFileName: string;
  UseRegistry: Boolean);
procedure RestoreFormPlacement(Form: TForm; const IniFileName: string;
  UseRegistry: Boolean);
procedure WriteFormPlacementReg(Form: TForm; IniFile: TRegIniFile;
  const Section: string);
procedure ReadFormPlacementReg(Form: TForm; IniFile: TRegIniFile;
  const Section: string; LoadState, LoadPosition: Boolean);
procedure SaveMDIChildrenReg(MainForm: TForm; IniFile: TRegIniFile);
procedure RestoreMDIChildrenReg(MainForm: TForm; IniFile: TRegIniFile);
procedure RestoreGridLayoutReg(Grid: TCustomGrid; IniFile: TRegIniFile);
procedure SaveGridLayoutReg(Grid: TCustomGrid; IniFile: TRegIniFile);
{$ELSE}
procedure SaveFormPlacement(Form: TForm; const IniFileName: string);
procedure RestoreFormPlacement(Form: TForm; const IniFileName: string);
{$ENDIF WIN32}

procedure WriteFormPlacement(Form: TForm; IniFile: TIniFile;
  const Section: string);
procedure ReadFormPlacement(Form: TForm; IniFile: TIniFile;
  const Section: string; LoadState, LoadPosition: Boolean);
procedure SaveMDIChildren(MainForm: TForm; IniFile: TIniFile);
procedure RestoreMDIChildren(MainForm: TForm; IniFile: TIniFile);
procedure RestoreGridLayout(Grid: TCustomGrid; IniFile: TIniFile);
procedure SaveGridLayout(Grid: TCustomGrid; IniFile: TIniFile);

function GetUniqueFileNameInDir(const Path, FileNameMask: string): string;

function StrToIniStr(const Str: string): string;
function IniStrToStr(const Str: string): string;

function IniReadString(IniFile: TObject; const Section, Ident,
  Default: string): string;
procedure IniWriteString(IniFile: TObject; const Section, Ident,
  Value: string);
function IniReadInteger(IniFile: TObject; const Section, Ident: string;
  Default: Longint): Longint;
procedure IniWriteInteger(IniFile: TObject; const Section, Ident: string;
  Value: Longint);
function IniReadBool(IniFile: TObject; const Section, Ident: string;
  Default: Boolean): Boolean;
procedure IniWriteBool(IniFile: TObject; const Section, Ident: string;
  Value: Boolean);
procedure IniReadSections(IniFile: TObject; Strings: TStrings);
procedure IniEraseSection(IniFile: TObject; const Section: string);
procedure IniDeleteKey(IniFile: TObject; const Section, Ident: string);

{$IFDEF WIN32}
procedure AppBroadcast(Msg, wParam: Longint; lParam: Longint);
{$ELSE}
procedure AppBroadcast(Msg, wParam: Word; lParam: Longint);
{$ENDIF WIN32}

procedure AppTaskbarIcons(AppOnly: Boolean);

{ Internal using utilities }

procedure InternalSaveGridLayout(Grid: TCustomGrid; IniFile: TObject;
  const Section: string);
procedure InternalRestoreGridLayout(Grid: TCustomGrid; IniFile: TObject;
  const Section: string);
procedure InternalSaveMDIChildren(MainForm: TForm; IniFile: TObject);
procedure InternalRestoreMDIChildren(MainForm: TForm; IniFile: TObject);

implementation

uses SysUtils, Messages, Consts, rxStrUtils, FileUtil, Placemnt;

function GetDefaultSection(Component: TComponent): string;
var
  F: TCustomForm;
  Owner: TComponent;
begin
  if Component <> nil then begin
    if Component is TCustomForm then Result := Component.ClassName
    else begin
      Result := Component.Name;
      if Component is TControl then begin
        F := GetParentForm(TControl(Component));
        if F <> nil then Result := F.ClassName + Result
        else begin
          if TControl(Component).Parent <> nil then
            Result := TControl(Component).Parent.Name + Result;
        end;
      end
      else begin
        Owner := Component.Owner;
        if Owner is TForm then
          Result := Format('%s.%s', [Owner.ClassName, Result]);
      end;
    end;
  end
  else Result := '';
end;

function GetDefaultIniName: string;
begin
  if Assigned(OnGetDefaultIniName) then
    Result:= OnGetDefaultIniName
  else
    Result := ExtractFileName(ChangeFileExt(Application.ExeName, '.INI'));
end;

{$IFDEF WIN32}
function GetDefaultIniRegKey: string;
begin
  if RegUseAppTitle and (Application.Title <> '') then
    Result := Application.Title
  else Result := ExtractFileName(ChangeFileExt(Application.ExeName, ''));
  if DefCompanyName <> '' then
    Result := DefCompanyName + '\' + Result;
  Result := 'Software\' + Result;
end;
{$ENDIF}

procedure GetDefaultIniData(Control: TControl; var IniFileName,
  Section: string {$IFDEF WIN32}; UseRegistry: Boolean {$ENDIF});
var
  I: Integer;
begin
  IniFileName := EmptyStr;
  with Control do
    if Owner is TCustomForm then
      for I := 0 to Owner.ComponentCount - 1 do
        if (Owner.Components[I] is TFormPlacement) then begin
          IniFileName := TFormPlacement(Owner.Components[I]).IniFileName;
          Break;
        end;
  Section := GetDefaultSection(Control);
  if IniFileName = EmptyStr then
{$IFDEF WIN32}
    if UseRegistry then IniFileName := GetDefaultIniRegKey
    else
{$ENDIF}
    IniFileName := GetDefaultIniName;
end;

function FindForm(FormClass: TFormClass): TForm;
var
  I: Integer;
begin
  Result := nil;
  for I := 0 to Screen.FormCount - 1 do begin
    if Screen.Forms[I] is FormClass then begin
      Result := Screen.Forms[I];
      Break;
    end;
  end;
end;

function InternalFindShowForm(FormClass: TFormClass;
  const Caption: string; Restore: Boolean): TForm;
var
  I: Integer;
begin
  Result := nil;
  for I := 0 to Screen.FormCount - 1 do begin
    if Screen.Forms[I] is FormClass then
      if (Caption = '') or (Caption = Screen.Forms[I].Caption) then begin
        Result := Screen.Forms[I];
        Break;
      end;
  end;
  if Result = nil then begin
    Application.CreateForm(FormClass, Result);
    if Caption <> '' then Result.Caption := Caption;
  end;
  with Result do begin
    if Restore and (WindowState = wsMinimized) then WindowState := wsNormal;
    Show;
  end;
end;

function FindShowForm(FormClass: TFormClass; const Caption: string): TForm;
begin
  Result := InternalFindShowForm(FormClass, Caption, True);
end;

function ShowDialog(FormClass: TFormClass): Boolean;
var
  Dlg: TForm;
begin
  Application.CreateForm(FormClass, Dlg);
  try
    Result := Dlg.ShowModal in [mrOk, mrYes];
  finally
    Dlg.Free;
  end;
end;

function InstantiateForm(FormClass: TFormClass; var Reference): TForm;
begin
  if TForm(Reference) = nil then
    Application.CreateForm(FormClass, Reference);
  Result := TForm(Reference);
end;

function StrToIniStr(const Str: string): string;
var
{$IFDEF WIN32}
  Buffer: array[0..4095] of Char;
{$ELSE}
  Buffer: array[0..255] of Char;
{$ENDIF}
  B, S: PChar;
begin
  if Length(Str) > SizeOf(Buffer) then
    raise Exception.Create(ResStr(SLineTooLong));
{$IFDEF WIN32}
  S := PChar(Str);
{$ELSE}
  S := StrPAlloc(Str);
{$ENDIF}
  try
    B := Buffer;
    while S^ <> #0 do
      case S^ of
        #13, #10:
          begin
            if (S^ = #13) and (S[1] = #10) then Inc(S)
            else if (S^ = #10) and (S[1] = #13) then Inc(S);
            B^ := '\';
            Inc(B);
            B^ := 'n';
            Inc(B);
            Inc(S);
          end;
      else
        B^ := S^;
        Inc(B);
        Inc(S);
      end;
  finally
{$IFNDEF WIN32}
    StrDispose(S);
{$ENDIF}
  end;
  B^ := #0;
  Result := StrPas(Buffer);
end;

function IniStrToStr(const Str: string): string;
var
{$IFDEF WIN32}
  Buffer: array[0..4095] of Char;
{$ELSE}
  Buffer: array[0..255] of Char;
{$ENDIF}
  B, S: PChar;
begin
  if Length(Str) > SizeOf(Buffer) then
    raise Exception.Create(ResStr(SLineTooLong));
{$IFDEF WIN32}
  S := PChar(Str);
{$ELSE}
  S := StrPAlloc(Str);
{$ENDIF}
  try
    B := Buffer;
    while S^ <> #0 do
      if (S[0] = '\') and (S[1] = 'n') then
      begin
        B^ := #13;
        Inc(B);
        B^ := #10;
        Inc(B);
        Inc(S);
        Inc(S);
      end
      else
      begin
        B^ := S^;
        Inc(B);
        Inc(S);
      end;
  finally
{$IFNDEF WIN32}
    StrDispose(S);
{$ENDIF}
  end;
  B^ := #0;
  Result := StrPas(Buffer);
end;

const
{ The following strings should not be localized }
  siFlags     = 'Flags';
  siShowCmd   = 'ShowCmd';
  siMinMaxPos = 'MinMaxPos';
  siNormPos   = 'NormPos';
  siPixels    = 'PixelsPerInch';
  siMDIChild  = 'MDI Children';
  siListCount = 'Count';
  siItem      = 'Item%d';

function IniReadString(IniFile: TObject; const Section, Ident,
  Default: string): string;
begin
{$IFDEF WIN32}
  if IniFile is TRegIniFile then
    Result := TRegIniFile(IniFile).ReadString(Section, Ident, Default)
  else
{$ENDIF}
  if IniFile is TIniFile then
    Result := TIniFile(IniFile).ReadString(Section, Ident, Default)
  else Result := Default;
end;

procedure IniWriteString(IniFile: TObject; const Section, Ident,
  Value: string);
var
  S: string;
begin
{$IFDEF WIN32}
  if IniFile is TRegIniFile then
    TRegIniFile(IniFile).WriteString(Section, Ident, Value)
  else begin
{$ENDIF}
    S := Value;
    if S <> '' then begin
      if ((S[1] = '"') and (S[Length(S)] = '"')) or
        ((S[1] = '''') and (S[Length(S)] = '''')) then
        S := '"' + S + '"';
    end;
    if IniFile is TIniFile then
      TIniFile(IniFile).WriteString(Section, Ident, S);
{$IFDEF WIN32}
  end;
{$ENDIF}
end;

function IniReadInteger(IniFile: TObject; const Section, Ident: string;
  Default: Longint): Longint;
begin
{$IFDEF WIN32}
  if IniFile is TRegIniFile then
    Result := TRegIniFile(IniFile).ReadInteger(Section, Ident, Default)
  else
{$ENDIF}
  if IniFile is TIniFile then
    Result := TIniFile(IniFile).ReadInteger(Section, Ident, Default)
  else Result := Default;
end;

procedure IniWriteInteger(IniFile: TObject; const Section, Ident: string;
  Value: Longint);
begin
{$IFDEF WIN32}
  if IniFile is TRegIniFile then
    TRegIniFile(IniFile).WriteInteger(Section, Ident, Value)
  else
{$ENDIF}
  if IniFile is TIniFile then
    TIniFile(IniFile).WriteInteger(Section, Ident, Value);
end;

function IniReadBool(IniFile: TObject; const Section, Ident: string;
  Default: Boolean): Boolean;
begin
{$IFDEF WIN32}
  if IniFile is TRegIniFile then
    Result := TRegIniFile(IniFile).ReadBool(Section, Ident, Default)
  else
{$ENDIF}
  if IniFile is TIniFile then
    Result := TIniFile(IniFile).ReadBool(Section, Ident, Default)
  else Result := Default;
end;

procedure IniWriteBool(IniFile: TObject; const Section, Ident: string;
  Value: Boolean);
begin
{$IFDEF WIN32}
  if IniFile is TRegIniFile then
    TRegIniFile(IniFile).WriteBool(Section, Ident, Value)
  else
{$ENDIF}
  if IniFile is TIniFile then
    TIniFile(IniFile).WriteBool(Section, Ident, Value);
end;

procedure IniEraseSection(IniFile: TObject; const Section: string);
begin
{$IFDEF WIN32}
  if IniFile is TRegIniFile then
    TRegIniFile(IniFile).EraseSection(Section)
  else
{$ENDIF}
  if IniFile is TIniFile then
    TIniFile(IniFile).EraseSection(Section);
end;

procedure IniDeleteKey(IniFile: TObject; const Section, Ident: string);
{$IFNDEF WIN32}
var
  CSection: array[0..127] of Char;
  CIdent: array[0..127] of Char;
  CFileName: array[0..127] of Char;
{$ENDIF}
begin
{$IFDEF WIN32}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频观看| 在线观看日韩精品| 亚洲国产精品久久人人爱| 久久这里只有精品视频网| 91成人免费电影| 成人激情免费视频| 亚洲综合一区二区| 久久精品视频一区| 久久影视一区二区| 7777精品久久久大香线蕉| 色综合久久中文字幕| 国产99久久久国产精品潘金| 精品系列免费在线观看| 亚洲蜜臀av乱码久久精品| 国产精品系列在线| 国产欧美1区2区3区| 久久久99精品免费观看不卡| 日韩欧美你懂的| 一本一道久久a久久精品| 成人av中文字幕| 成人一级片网址| 成人app软件下载大全免费| 国产精品99精品久久免费| 激情五月激情综合网| 六月婷婷色综合| 国产一区二区三区最好精华液| 美国三级日本三级久久99| 免费高清成人在线| 美女一区二区三区在线观看| 加勒比av一区二区| 福利电影一区二区三区| 色哟哟国产精品| 51精品国自产在线| 国产a视频精品免费观看| 另类专区欧美蜜桃臀第一页| 成人欧美一区二区三区视频网页 | 色老头久久综合| 国产精品香蕉一区二区三区| 日本成人在线一区| 亚洲午夜国产一区99re久久| 亚洲视频在线一区二区| 国产日韩欧美不卡| 精品欧美乱码久久久久久| 亚洲视频免费看| 久久综合网色—综合色88| 国产精品入口麻豆原神| 一区二区三区视频在线观看| 午夜影院久久久| 国模冰冰炮一区二区| 福利视频网站一区二区三区| 日本精品裸体写真集在线观看| 91蜜桃网址入口| 精品一区二区久久| 裸体在线国模精品偷拍| 蜜臀av亚洲一区中文字幕| 免费看欧美美女黄的网站| 亚洲午夜国产一区99re久久| 精品一区中文字幕| 波多野洁衣一区| 7777精品伊人久久久大香线蕉的 | 中文字幕亚洲视频| 亚洲自拍偷拍综合| 风间由美性色一区二区三区| 日韩精品一区二区三区swag | 国产欧美一区二区三区沐欲 | 久久久久久久久久久久久夜| 欧美一级免费大片| 久久久午夜电影| 亚洲人成小说网站色在线| 欧美乱熟臀69xxxxxx| 欧美xxxxx牲另类人与| 免费在线看成人av| 日韩欧美三级在线| 久久国产生活片100| 日韩欧美在线观看一区二区三区| 午夜亚洲福利老司机| 欧美最猛黑人xxxxx猛交| 亚洲精品免费电影| 91黄视频在线| 亚洲一区二区美女| 91精品婷婷国产综合久久竹菊| 婷婷开心激情综合| 3atv一区二区三区| 美国十次了思思久久精品导航| 日韩欧美另类在线| 国产很黄免费观看久久| 国产欧美日韩精品一区| 不卡的电视剧免费网站有什么| 国产精品久久久久久久久免费樱桃 | 亚洲天堂成人网| 色呦呦网站一区| 亚洲va天堂va国产va久| 欧美一区二区精品在线| 国产在线国偷精品产拍免费yy| 久久久综合视频| 成人午夜激情视频| 一区二区在线免费| 91精品欧美综合在线观看最新| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美精品一区二区三区四区| 懂色av一区二区夜夜嗨| 亚洲免费视频成人| 欧美一区二区三区思思人| 成人动漫视频在线| 夜夜操天天操亚洲| 欧美一区二区三区在线观看视频| 国产一区不卡视频| 亚洲男人的天堂在线观看| 欧美日韩国产123区| 黄页网站大全一区二区| 亚洲日本va午夜在线电影| 欧美精选一区二区| 国产精品99久久久久久久vr| 一区二区三区精密机械公司| 日韩欧美色综合网站| 成人app软件下载大全免费| 天天综合色天天| 国产精品美女一区二区三区| 欧美人伦禁忌dvd放荡欲情| 国产精品91xxx| 日日摸夜夜添夜夜添亚洲女人| 久久综合资源网| 欧美日韩另类一区| 99久久精品国产麻豆演员表| 久久精品99国产精品| 亚洲欧美日韩国产另类专区| 久久亚洲影视婷婷| 欧美卡1卡2卡| 在线一区二区视频| 成人一区在线观看| 另类小说图片综合网| 亚洲午夜久久久| 综合激情成人伊人| 国产亚洲综合av| 欧美一区二区三区在线观看| 91国产视频在线观看| 波多野结衣91| 懂色一区二区三区免费观看| 精品亚洲国内自在自线福利| 亚洲一区二三区| 玉足女爽爽91| 亚洲免费在线观看视频| 国产精品视频第一区| 久久亚洲综合色| 久久久亚洲精品一区二区三区| 欧美一区二区三区白人| 免费观看日韩电影| 国产人久久人人人人爽| 欧美大胆一级视频| 在线电影一区二区三区| 日本韩国欧美在线| 一本到三区不卡视频| 成人午夜精品在线| 成人免费精品视频| 国产精品自拍av| 久久国产乱子精品免费女| 免费xxxx性欧美18vr| 日韩精品国产精品| 青青草国产成人av片免费| 婷婷国产在线综合| 日本最新不卡在线| 精品影视av免费| 国产揄拍国内精品对白| 国产一区在线精品| 亚洲国产精品av| 日本电影亚洲天堂一区| 五月婷婷另类国产| 日韩一区二区三区电影在线观看| 国产一区二区美女诱惑| 1024亚洲合集| 日韩精品一区第一页| 亚洲女性喷水在线观看一区| 亚洲免费伊人电影| 无码av免费一区二区三区试看| 亚洲成av人片一区二区三区| 麻豆精品视频在线| 国产成人综合视频| 国产成人精品1024| 91小宝寻花一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 欧美日本视频在线| 亚洲精品在线观| 亚洲色图制服诱惑| 日产欧产美韩系列久久99| 国产成人亚洲精品狼色在线| 97久久精品人人做人人爽50路| 欧美日韩高清影院| 精品播放一区二区| 亚洲欧美日本韩国| 久久丁香综合五月国产三级网站| 成人午夜电影网站| 国产婷婷一区二区| 欧美精品电影在线播放| av在线一区二区三区| 日本欧美在线看| 亚洲最大色网站| 久久97超碰色| www.日本不卡| 久久先锋影音av鲁色资源网| 亚洲一区二区三区视频在线播放|