亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
一区二区三区加勒比av| 国内精品伊人久久久久av影院| 性感美女久久精品| 狠狠网亚洲精品| 欧美色成人综合| 亚洲国产精品t66y| 久久爱另类一区二区小说| 91久久精品午夜一区二区| 国产人妖乱国产精品人妖| 秋霞电影网一区二区| 欧美吞精做爰啪啪高潮| 亚洲国产乱码最新视频| 国产成人精品三级| 欧美一区二区三区视频| 亚洲一二三级电影| 9色porny自拍视频一区二区| 精品久久久久久久人人人人传媒 | 亚洲电影视频在线| 99国产精品99久久久久久| 欧美精品一区二区三区久久久| 亚洲成精国产精品女| 色综合久久久久综合体桃花网| 日韩精品一区二区三区蜜臀 | 天堂蜜桃一区二区三区| 一本久久a久久免费精品不卡| 精品国内二区三区| 蜜臀久久99精品久久久久宅男 | 亚洲乱码精品一二三四区日韩在线| 欧美午夜在线观看| 中文一区一区三区高中清不卡| 人人精品人人爱| 在线播放一区二区三区| 亚洲国产欧美在线| 欧美午夜片在线观看| 艳妇臀荡乳欲伦亚洲一区| 91蜜桃婷婷狠狠久久综合9色| 亚洲国产成人在线| 成人精品视频一区二区三区尤物| 久久久av毛片精品| 国产电影一区二区三区| 中文字幕高清一区| www.欧美色图| 亚洲乱码中文字幕| 欧美久久久久久久久久| 日韩av不卡一区二区| 日韩一区二区在线观看| 国模无码大尺度一区二区三区| 精品欧美黑人一区二区三区| 国内一区二区在线| 欧美激情一区在线观看| 成人a级免费电影| 亚洲综合丁香婷婷六月香| 欧美日韩在线不卡| 伦理电影国产精品| 久久精品在这里| 91亚洲精华国产精华精华液| 一区二区三区中文在线观看| 欧美老肥妇做.爰bbww| 美女脱光内衣内裤视频久久网站| 久久久久久毛片| 97成人超碰视| 偷拍日韩校园综合在线| 国产网站一区二区| 欧美性生活久久| 美女网站在线免费欧美精品| 国产日产亚洲精品系列| 欧美午夜精品一区二区三区| 久久se精品一区二区| 国产精品你懂的在线| 色爱区综合激月婷婷| 蜜桃av噜噜一区二区三区小说| 国产亚洲综合在线| 欧美日韩午夜在线视频| 国产美女精品在线| 亚洲大片免费看| 久久久影视传媒| 色播五月激情综合网| 国产一区二区久久| 亚洲国产成人av网| 国产精品久久久久四虎| 在线成人av影院| 成人免费精品视频| 免费观看一级欧美片| 一区二区三区在线免费视频| 欧美va亚洲va在线观看蝴蝶网| 91精品办公室少妇高潮对白| 国内精品伊人久久久久av一坑| 一区二区在线观看视频在线观看| 久久亚洲免费视频| 欧美一个色资源| 日本道色综合久久| 成人性色生活片| 麻豆精品视频在线| 天天综合色天天综合色h| 国产精品视频一二| 日韩精品一区二区三区在线| 欧美亚洲尤物久久| 91免费观看视频在线| 国产成人综合在线| 国产一区免费电影| 日本vs亚洲vs韩国一区三区二区| 亚洲自拍偷拍欧美| 亚洲三级电影网站| 国产精品午夜在线观看| 欧美精品一区视频| 欧美成人r级一区二区三区| 欧美在线观看一区| 色天使久久综合网天天| jlzzjlzz国产精品久久| 国产福利一区二区三区视频在线 | 亚洲午夜精品网| 国产精品国产三级国产| 国产精品视频看| 国产精品水嫩水嫩| 国产精品久久三区| 国产精品网站在线观看| 日本一二三四高清不卡| 中文字幕精品一区二区三区精品| 久久精品人人爽人人爽| 国产精品视频第一区| 国产精品国产三级国产普通话三级| 久久九九国产精品| 国产精品天美传媒| 亚洲图片激情小说| 亚洲精品中文字幕乱码三区| 亚洲免费资源在线播放| 樱花影视一区二区| 午夜影院在线观看欧美| 日韩二区三区四区| 麻豆一区二区三| 国产精品91xxx| 不卡的电视剧免费网站有什么| 成人av在线播放网站| 日本精品一区二区三区高清| 欧美男生操女生| 欧美α欧美αv大片| 国产三级久久久| 亚洲男人天堂一区| 天天av天天翘天天综合网色鬼国产 | 国产99久久久国产精品潘金| 不卡av免费在线观看| 色综合久久久久久久| 91精品国产91热久久久做人人| 2023国产精品视频| 亚洲欧美综合色| 日本美女一区二区三区| 国产精品一区二区91| 99re热视频精品| 在线电影一区二区三区| 国产日韩av一区| 五月婷婷综合激情| 国产**成人网毛片九色 | 欧美一区二区精品| 国产欧美日韩亚州综合| 亚洲天堂成人网| 日韩av电影天堂| 国产激情视频一区二区三区欧美 | 亚洲精品日日夜夜| 精品综合免费视频观看| 91蜜桃网址入口| 26uuu国产一区二区三区| 一区二区三区毛片| 国产福利精品导航| 91精品国产欧美一区二区| 中文字幕制服丝袜一区二区三区| 午夜视频在线观看一区二区| 成人性生交大片| 精品国产一区二区三区久久影院| 一区二区三区在线视频免费| 国产真实乱偷精品视频免| 欧美在线啊v一区| 国产精品欧美经典| 国内久久精品视频| 欧美日韩精品一区二区三区蜜桃| 国产精品无圣光一区二区| 麻豆精品在线看| 欧美欧美欧美欧美首页| 亚洲视频免费在线观看| 韩国v欧美v日本v亚洲v| 91精品欧美一区二区三区综合在| 国产精品久久久久久久浪潮网站| 麻豆91在线观看| 欧美日韩一区中文字幕| 日韩一区在线免费观看| 国产成人午夜视频| 欧美精品一区二| 美腿丝袜亚洲一区| 欧美精品日日鲁夜夜添| 亚洲永久免费视频| 91在线播放网址| 国产精品拍天天在线| 国产91丝袜在线18| 久久久久久久性| 国产老肥熟一区二区三区| 欧美一级一级性生活免费录像| 亚洲国产日韩一级| 精品视频色一区| 亚洲妇女屁股眼交7| 欧美在线小视频| 亚洲午夜激情网站|