unit custom_copy; //{$DEFINE _DEBUG} interface uses Windows, Messages, SysUtils, Graphics, Controls, Forms, ComCtrls, ExtCtrls, StdCtrls, Grids, ActnList, Menus, Classes, ImgList, ToolWin, CheckLst, Buttons, Spin; type TForm_Custom_Copy = class(TForm) ActionList1: TActionList; actFile_Close: TAction; actCopy_ResetAll: TAction; actCopy_ZoomReset: TAction; actCopy_ColorRGBReset: TAction; actCopy_ColorRGBRedReset: TAction; actCopy_ColorRGBGreenReset: TAction; actCopy_ColorRGBBlueReset: TAction; actCopy_ColorHTMLReset: TAction; actCopy_ColorCOLOREFReset: TAction; actCopy_ColorHSVReset: TAction; actCopy_ColorHLSReset: TAction; actCopy_ColorHLSWindowsReset: TAction; actCopy_PosScreenReset: TAction; actCopy_PosMonitorReset: TAction; actCopy_PosClientReset: TAction; actCopy_PosUserReset: TAction; actCopy_WinInfoHandleReset: TAction; actCopy_WinInfoClassNameReset: TAction; actCopy_WinInfoTextReset: TAction; actCopy_WinInfoWindowSizeReset: TAction; actCopy_WinInfoClientSizeReset: TAction; actCopy_WinInfoRectReset: TAction; actCopy_WinInfoControlIDReset: TAction; actCopy_WinInfoStyleReset: TAction; actCopy_WinInfoStyleExReset: TAction; actCopy_WinInfoPIDReset: TAction; actCopy_WinInfoExeNameReset: TAction; actCopy_WinInfoFileVersionReset: TAction; Label_Copy_Title: TLabel; ComboBox_Copy_FmtSel: TComboBox; lblCopy_Zoom: TLabel; lblCopy_Color: TLabel; lblCopy_Pos: TLabel; lblCopy_WinInfo: TLabel; shpCopy: TShape; shpCopy2: TShape; Panel_Cmd: TPanel; Button_Reset: TButton; Button_Close: TButton; ScrollBox_Copy: TScrollBox; pnlCopy_Zoom: TPanel; lblCopy_ZoomTitle: TLabel; btnCopy_ZoomReset: TButton; chkCopy_ZoomInfo: TCheckBox; chkCopy_ZoomGrid: TCheckBox; pnlCopy_PosScreen: TPanel; shpCopy_PosScreen: TShape; lblCopy_PosScreenDisp: TLabel; lblCopy_PosScreenY: TLabel; lblCopy_PosScreenX: TLabel; lblCopy_PosScreenTitle: TLabel; btnCopy_PosScreenReset: TButton; edtCopy_PosScreen3: TEdit; edtCopy_PosScreen2: TEdit; edtCopy_PosScreen1: TEdit; pnlCopy_PosMonitor: TPanel; shpCopy_PosMonitor: TShape; lblCopy_PosMonitorDisp: TLabel; lblCopy_PosMonitorY: TLabel; lblCopy_PosMonitorX: TLabel; lblCopy_PosMonitorTitle: TLabel; btnCopy_PosMonitorReset: TButton; edtCopy_PosMonitor3: TEdit; edtCopy_PosMonitor2: TEdit; edtCopy_PosMonitor1: TEdit; pnlCopy_PosClient: TPanel; shpCopy_PosClient: TShape; lblCopy_PosClientDisp: TLabel; lblCopy_PosClientY: TLabel; lblCopy_PosClientX: TLabel; lblCopy_PosClientTitle: TLabel; btnCopy_PosClientReset: TButton; edtCopy_PosClient3: TEdit; edtCopy_PosClient2: TEdit; edtCopy_PosClient1: TEdit; pnlCopy_PosUser: TPanel; lblCopy_PosUserDisp: TLabel; lblCopy_PosUserOriginY: TLabel; lblCopy_PosUserOriginX: TLabel; lblCopy_PosUserY: TLabel; lblCopy_PosUserX: TLabel; lblCopy_PosUserTitle: TLabel; btnCopy_PosUserReset: TButton; chkCopy_PosUserOrigin: TCheckBox; edtCopy_PosUser5: TEdit; edtCopy_PosUser4: TEdit; edtCopy_PosUser3: TEdit; edtCopy_PosUser2: TEdit; edtCopy_PosUser1: TEdit; pnlCopy_ColorRGB: TPanel; shpCopy_ColorRGB: TShape; lblCopy_ColorRGBDisp: TLabel; lblCopy_ColorRGB_Blue: TLabel; lblCopy_ColorRGB_Green: TLabel; lblCopy_ColorRGB_Red: TLabel; lblCopy_ColorRGBTitle: TLabel; btnCopy_ColorRGBReset: TButton; chkCopy_ColorRGBHex: TCheckBox; edtCopy_ColorRGB4: TEdit; edtCopy_ColorRGB3: TEdit; edtCopy_ColorRGB2: TEdit; edtCopy_ColorRGB1: TEdit; pnlCopy_ColorRGBRed: TPanel; shpCopy_ColorRGBRed: TShape; lblCopy_ColorRGBRedDisp: TLabel; lblCopy_ColorRGBRed: TLabel; lblCopy_ColorRGBRedTitle: TLabel; btnCopy_ColorRGBRedReset: TButton; chkCopy_ColorRGBRedHex: TCheckBox; edtCopy_ColorRGBRed2: TEdit; edtCopy_ColorRGBRed1: TEdit; pnlCopy_ColorRGBGreen: TPanel; shpCopy_ColorRGBGreen: TShape; lblCopy_ColorRGBGreenDisp: TLabel; lblCopy_ColorRGBGreen: TLabel; lblCopy_ColorRGBGreenTitle: TLabel; btnCopy_ColorRGBGreenReset: TButton; chkCopy_ColorRGBGreenHex: TCheckBox; edtCopy_ColorRGBGreen2: TEdit; edtCopy_ColorRGBGreen1: TEdit; pnlCopy_ColorRGBBlue: TPanel; shpCopy_ColorRGBBlue: TShape; lblCopy_ColorRGBBlueDisp: TLabel; lblCopy_ColorRGBBlue: TLabel; lblCopy_ColorRGBBlueTitle: TLabel; btnCopy_ColorRGBBlue: TButton; chkCopy_ColorRGBBlueHex: TCheckBox; edtCopy_ColorRGBBlue2: TEdit; edtCopy_ColorRGBBlue1: TEdit; pnlCopy_ColorHTML: TPanel; shpCopy_ColorHTML: TShape; lblCopy_ColorHTMLDisp: TLabel; lblCopy_ColorHTML: TLabel; lblCopy_ColorHTMLTitle: TLabel; btnCopy_ColorHTMLReset: TButton; edtCopy_ColorHTML2: TEdit; edtCopy_ColorHTML1: TEdit; pnlCopy_ColorCOLORREF: TPanel; shpCopy_ColorCOLORREF: TShape; lblCopy_ColorCOLORREFDisp: TLabel; lblCopy_ColorCOLORREF: TLabel; lblCopy_ColorCOLORREFTitle: TLabel; btnCopy_ColorCOLORREFReset: TButton; chkCopy_ColorCOLORREFHex: TCheckBox; edtCopy_ColorCOLORREF2: TEdit; edtCopy_ColorCOLORREF1: TEdit; pnlCopy_ColorHSV: TPanel; shpCopy_ColorHSV: TShape; lblCopy_ColorHSVDisp: TLabel; lblCopy_ColorHSVValue: TLabel; lblCopy_ColorHSVSaturation: TLabel; lblCopy_ColorHSVHue: TLabel; lblCopy_ColorHSVTitle: TLabel; btnCopy_ColorHSVReset: TButton; edtCopy_ColorHSV4: TEdit; edtCopy_ColorHSV3: TEdit; edtCopy_ColorHSV2: TEdit; edtCopy_ColorHSV1: TEdit; pnlCopy_ColorHLS: TPanel; shpCopy_ColorHLS: TShape; lblCopy_ColorHLSDisp: TLabel; lblCopy_ColorHLSLightness: TLabel; lblCopy_ColorHLSSaturation: TLabel; lblCopy_ColorHLSHue: TLabel; lblCopy_ColorHLSTitle: TLabel; btnCopy_ColorHLSReset: TButton; edtCopy_ColorHLS4: TEdit; edtCopy_ColorHLS3: TEdit; edtCopy_ColorHLS2: TEdit; edtCopy_ColorHLS1: TEdit; pnlCopy_ColorHLSWin: TPanel; lblCopy_ColorHLSWinDisp: TLabel; lblCopy_ColorHLSWinLightness: TLabel; lblCopy_ColorHLSWinSaturation: TLabel; lblCopy_ColorHLSWinHue: TLabel; lblCopy_ColorHLSWinTitle: TLabel; btnCopy_ColorHLSWinReset: TButton; edtCopy_ColorHLSWin4: TEdit; edtCopy_ColorHLSWin3: TEdit; edtCopy_ColorHLSWin2: TEdit; edtCopy_ColorHLSWin1: TEdit; pnlCopy_WinInfoHandle: TPanel; shpCopy_WinInfoHandle: TShape; lblCopy_WinInfoHandleDisp: TLabel; lblCopy_WinInfoHandle: TLabel; lblCopy_WinInfoHandleTitle: TLabel; btnCopy_WinInfoHandleReset: TButton; chkCopy_WinInfoHandleHex: TCheckBox; edtCopy_WinInfoHandle2: TEdit; edtCopy_WinInfoHandle1: TEdit; pnlCopy_WinInfoClassName: TPanel; shpCopy_WinInfoClassName: TShape; lblCopy_WinInfoClassNameTitle: TLabel; lblCopy_WinInfoClassNameDisp: TLabel; lblCopy_WinInfoClassName: TLabel; btnCopy_WinInfoClassNameReset: TButton; edtCopy_WinInfoClassName2: TEdit; edtCopy_WinInfoClassName1: TEdit; pnlCopy_WinInfoText: TPanel; shpCopy_WinInfoText: TShape; lblCopy_WinInfoTextDisp: TLabel; lblCopy_WinInfoText: TLabel; lblCopy_WinInfoTextTitle: TLabel; btnCopy_WinInfoTextReset: TButton; edtCopy_WinInfoText2: TEdit; edtCopy_WinInfoText1: TEdit; pnlCopy_WinInfoWindowSize: TPanel; shpCopy_WinInfoWindowSize: TShape; lblCopy_WinInfoWindowSizeDisp: TLabel; lblCopy_WinInfoWindowSizeHeight: TLabel; lblCopy_WinInfoWindowSizeWidth: TLabel; lblCopy_WinInfoWindowSizeTop: TLabel; lblCopy_WinInfoWindowSizeLeft: TLabel; lblCopy_WinInfoWindowSizeTitle: TLabel; btnCopy_WinInfoWindowSizeReset: TButton; edtCopy_WinInfoWindowSize5: TEdit; edtCopy_WinInfoWindowSize4: TEdit; edtCopy_WinInfoWindowSize3: TEdit; edtCopy_WinInfoWindowSize2: TEdit; edtCopy_WinInfoWindowSize1: TEdit; pnlCopy_WinInfoClientSize: TPanel; shpCopy_WinInfoClientSize: TShape; lblCopy_WinInfoClientSizeTitle: TLabel; lblCopy_WinInfoClientSizeDisp: TLabel; lblCopy_WinInfoClientSizeHeight: TLabel; lblCopy_WinInfoClientSizeWidth: TLabel; btnCopy_WinInfoClientSizeReset: TButton; edtCopy_WinInfoClientSize3: TEdit; edtCopy_WinInfoClientSize2: TEdit; edtCopy_WinInfoClientSize1: TEdit; pnlCopy_WinInfoRect: TPanel; shpCopy_WinInfoRect: TShape; lblCopy_WinInfoRectDisp: TLabel; lblCopy_WinInfoRectBottom: TLabel; lblCopy_WinInfoRectRight: TLabel; lblCopy_WinInfoRectTop: TLabel; lblCopy_WinInfoRectLeft: TLabel; lblCopy_WinInfoRectTitle: TLabel; btnCopy_WinInfoRectReset: TButton; edtCopy_WinInfoRect5: TEdit; edtCopy_WinInfoRect4: TEdit; edtCopy_WinInfoRect3: TEdit; edtCopy_WinInfoRect2: TEdit; edtCopy_WinInfoRect1: TEdit; pnlCopy_WinInfoControlID: TPanel; shpCopy_WinInfoControlID: TShape; lblCopy_WinInfoControlIDDisp: TLabel; lblCopy_WinInfoControlIDValue: TLabel; lblCopy_WinInfoControlIDTitle: TLabel; btnCopy_WinInfoControlIDReset: TButton; edtCopy_WinInfoControlIDEdit2: TEdit; edtCopy_WinInfoControlIDEdit1: TEdit; pnlCopy_WinInfoStyle: TPanel; shpCopy_WinInfoStyle: TShape; lblCopy_WinInfoStyleDisp: TLabel; lblCopy_WinInfoStyle: TLabel; lblCopy_WinInfoStyleTitle: TLabel; btnCopy_WinInfoStyleReset: TButton; chkCopy_WinInfoStyleHex: TCheckBox; edtCopy_WinInfoStyle2: TEdit; edtCopy_WinInfoStyle1: TEdit; pnlCopy_WinInfoStyleEx: TPanel; shpCopy_WinInfoWindowStyleEx: TShape; lblCopy_WinInfoStyleExDisp: TLabel; lblCopy_WinInfoStyleEx: TLabel; lblCopy_WinInfoStyleExTitle: TLabel; btnCopy_WinInfoStyleEx: TButton; chkCopy_WinInfoStyleExHex: TCheckBox; edtCopy_WinInfoStyleEx2: TEdit; edtCopy_WinInfoStyleEx1: TEdit; pnlCopy_WinInfoPID: TPanel; shpCopy_WinInfoPID: TShape; lblCopy_WinInfoPIDDisp: TLabel; lblCopy_WinInfoPID: TLabel; lblCopy_WinInfoPIDTitle: TLabel; btnCopy_WinInfoPIDReset: TButton; chkCopy_WinInfoPIDHex: TCheckBox; edtCopy_WinInfoPID2: TEdit; edtCopy_WinInfoPID1: TEdit; pnlCopy_WinInfoExeName: TPanel; lblCopy_WinInfoExeNameTitle: TLabel; edtCopy_WinInfoExeName1: TEdit; lblCopy_WinInfoExeName: TLabel; edtCopy_WinInfoExeName2: TEdit; chkCopy_WinInfoExeNameFileName: TCheckBox; lblCopy_WinInfoExeNameDisp: TLabel; btnCopy_WinInfoExeNameReset: TButton; shpCopy_WinInfoExeName: TShape; pnlCopy_WinInfoFileVersion: TPanel; shpCopy_WinInfoFileVersion: TShape; lblCopy_WinInfoFileVersionDisp: TLabel; lblCopy_WinInfoFileVersion: TLabel; lblCopy_WinInfoFileVersionTitle: TLabel; btnCopy_WinInfoFileVersionReset: TButton; edtCopy_WinInfoFileVersion2: TEdit; edtCopy_WinInfoFileVersion1: TEdit; procedure FormCreate (Sender: TObject); procedure FormClose (Sender: TObject; var Action: TCloseAction); procedure FormKeyUp (Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); procedure actFile_CloseExecute(Sender: TObject); procedure ComboBox_Copy_FmtSelSelect(Sender: TObject); procedure ComboBox_Copy_FmtSelKeyUp (Sender: TObject; var Key: Word; Shift: TShiftState); //コピー形式 procedure actCopy_ResetAllExecute (Sender: TObject); procedure actCopy_ZoomResetExecute (Sender: TObject); procedure chkCopy_ZoomGridClick (Sender: TObject); procedure actCopy_ColorRGBRedResetExecute (Sender: TObject); procedure edtCopy_ColorRGBRed1Change (Sender: TObject); procedure actCopy_ColorRGBGreenResetExecute (Sender: TObject); procedure edtCopy_ColorRGBGreen1Change (Sender: TObject); procedure actCopy_ColorRGBBlueResetExecute (Sender: TObject); procedure edtCopy_ColorRGBBlue1Change (Sender: TObject); procedure actCopy_ColorRGBResetExecute (Sender: TObject); procedure edtCopy_ColorRGB1Change (Sender: TObject); procedure actCopy_ColorHTMLResetExecute (Sender: TObject); procedure edtCopy_ColorHTML1Change (Sender: TObject); procedure actCopy_ColorCOLORREFResetExecute (Sender: TObject); procedure edtCopy_ColorCOLORREF1Change (Sender: TObject); procedure actCopy_ColorHSVResetExecute (Sender: TObject); procedure edtCopy_ColorHSV1Change (Sender: TObject); procedure actCopy_ColorHLSResetExecute (Sender: TObject); procedure edtCopy_ColorHLS1Change (Sender: TObject); procedure actCopy_ColorHLSWinResetExecute (Sender: TObject); procedure edtCopy_ColorHLSWin1Change (Sender: TObject); procedure actCopy_PosScreenResetExecute (Sender: TObject); procedure edtCopy_PosScreen1Change (Sender: TObject); procedure actCopy_PosMonitorResetExecute (Sender: TObject); procedure edtCopy_PosMonitor1Change (Sender: TObject); procedure actCopy_PosClientResetExecute (Sender: TObject); procedure edtCopy_PosClient1Change (Sender: TObject); procedure actCopy_PosUserResetExecute (Sender: TObject); procedure edtCopy_PosUser1Change (Sender: TObject); procedure actCopy_WinInfoHandleResetExecute (Sender: TObject); procedure edtCopy_WinInfoHandle1Change (Sender: TObject); procedure actCopy_WinInfoClassNameResetExecute (Sender: TObject); procedure edtCopy_WinInfoText1Change (Sender: TObject); procedure actCopy_WinInfoTextResetExecute (Sender: TObject); procedure edtCopy_WinInfoClassName1Change (Sender: TObject); procedure actCopy_WinInfoWindowSizeResetExecute (Sender: TObject); procedure edtCopy_WinInfoWindowSize1Change (Sender: TObject); procedure actCopy_WinInfoClientSizeResetExecute (Sender: TObject); procedure edtCopy_WinInfoClientSize1Change (Sender: TObject); procedure actCopy_WinInfoRectResetExecute (Sender: TObject); procedure edtCopy_WinInfoRect1Change (Sender: TObject); procedure actCopy_WinInfoControlIDResetExecute (Sender: TObject); procedure edtCopy_WinInfoControlIDEdit1Change (Sender: TObject); procedure actCopy_WinInfoStyleResetExecute (Sender: TObject); procedure edtCopy_WinInfoStyle1Change (Sender: TObject); procedure actCopy_WinInfoStyleExResetExecute (Sender: TObject); procedure edtCopy_WinInfoStyleEx1Change (Sender: TObject); procedure actCopy_WinInfoPIDResetExecute (Sender: TObject); procedure actCopy_WinInfoExeNameResetExecute (Sender: TObject); procedure edtCopy_WinInfoPID1Change (Sender: TObject); procedure pnlCopy_WinInfoPIDClick (Sender: TObject); procedure edtCopy_WinInfoExeName1Change (Sender: TObject); procedure edtCopy_WinInfoFileVersion1Change (Sender: TObject); procedure actCopy_WinInfoFileVersionResetExecute(Sender: TObject); procedure ComboBox_Copy_FmtSelDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); private { Private 宣言 } function F_GetTrueFalse(sValue: String): Boolean; overload; function F_GetTrueFalse(bChecked: Boolean): String; overload; function F_GetCategoryMsg(AMenuItem: TMenuItem): String; procedure FSetHighDPIControlHeight; public { Public 宣言 } end; //------------------------------------------------------------------------------ procedure G_pcCreateCopyForm; var Form_Custom_Copy: TForm_Custom_Copy; //============================================================================== implementation uses {$IFDEF _DEBUG} myDebug, {$ENDIF} general, custom_base, lang, main, highDPIUnit, common; {$R *.dfm} //============================================================================== procedure G_pcCreateCopyForm; procedure _CreateForm; begin Form_Custom_Copy := TForm_Custom_Copy.Create(G_MainForm); end; var i: Integer; begin if (Form_Custom_Copy = nil) then begin _CreateForm; end else begin for i := 0 to Screen.FormCount -1 do begin if (Screen.Forms[i] = Form_Custom_Copy) then begin Exit; end; end; _CreateForm; end; end; //============================================================================== procedure TForm_Custom_Copy.FSetHighDPIControlHeight; begin gpcItemHeightSet(ComboBox_Copy_FmtSel); ComboBox_Copy_FmtSel.Items.Add(''); //ダミー ComboBox_Copy_FmtSel.Items.Delete(ComboBox_Copy_FmtSel.Items.Count -1); //ComboBoxはItemHeightに値をセットした後にアイテムを追加しないと表示されるまで高さが変わらない。 //アイテム追加後にItemHeightをセットしたのではうまくいかない。 Label_Copy_Title.Height := ComboBox_Copy_FmtSel.Height + (G_ciCONTROL_MARGIN * 2); G_ControlTopSet(ComboBox_Copy_FmtSel); //下部のコマンドボタンの調整 gpcButtonHeightSet(Button_Reset); gpcButtonHeightSet(Button_Close); G_PanelCmdHieghtSet(Panel_Cmd); G_ControlTopSet(Button_Reset); G_ControlTopSet(Button_Close); G_ControlLeftSet(Button_Reset); G_CloseButtonLeftSet(Button_Close); end; procedure TForm_Custom_Copy.FormCreate(Sender: TObject); var i: Integer; lh_Menu: HMENU; l_MenuItem: TMenuItem; begin G_pcCreateCustomBaseForm; Self.ManualDock(G_CustomForm.tabCopy); Self.Align := alClient; Self.Visible := True; //システムメニュー lh_Menu := GetSystemMenu(Handle, False); DeleteMenu(lh_Menu, SC_RESTORE, MF_BYCOMMAND); //元のサイズに戻す DeleteMenu(lh_Menu, SC_MINIMIZE, MF_BYCOMMAND); //最小化 DeleteMenu(lh_Menu, SC_MAXIMIZE, MF_BYCOMMAND); //最大化 DrawMenuBar(lh_Menu); //高DPI対応 FSetHighDPIControlHeight; //コピー形式 ScrollBox_Copy.Align := alClient; ScrollBox_Copy.AutoScroll := True; ScrollBox_Copy.VertScrollBar.Position := 0; // Scrollbox_Copy.DoubleBuffered := True; Self.DoubleBuffered := True; // chkOpt_Unicode.Checked := App_BugsEye.Action_Copy_OptUnicode.Checked; // chkOpt_Unicode.Action := App_BugsEye.Action_Copy_OptUnicode; // chkOpt_Unicode.Caption := StripHotKey(chkOpt_Unicode.Caption); actCopy_ZoomResetExecute(nil); actCopy_ColorRGBResetExecute(nil); actCopy_ColorRGBRedResetExecute(nil); actCopy_ColorRGBGreenResetExecute(nil); actCopy_ColorRGBBlueResetExecute(nil); actCopy_ColorHTMLResetExecute(nil); actCopy_ColorCOLORREFResetExecute(nil); actCopy_ColorHSVResetExecute(nil); actCopy_ColorHLSResetExecute(nil); actCopy_ColorHLSWinResetExecute(nil); actCopy_PosScreenResetExecute(nil); actCopy_PosMonitorResetExecute(nil); actCopy_PosClientResetExecute(nil); actCopy_PosUserResetExecute(nil); actCopy_WinInfoHandleResetExecute(nil); actCopy_WinInfoClassNameResetExecute(nil); actCopy_WinInfoTextResetExecute(nil); actCopy_WinInfoWindowSizeResetExecute(nil); actCopy_WinInfoClientSizeResetExecute(nil); actCopy_WinInfoRectResetExecute(nil); actCopy_WinInfoControlIDResetExecute(nil); actCopy_WinInfoStyleResetExecute(nil); actCopy_WinInfoStyleExResetExecute(nil); actCopy_WinInfoPIDResetExecute(nil); actCopy_WinInfoExeNameResetExecute(nil); actCopy_WinInfoFileVersionResetExecute(nil); with G_MainForm do begin for i := 0 to MenuItem_Copy.Count -1 do begin l_MenuItem := MenuItem_Copy.Items[i]; if (l_MenuItem.Caption <> '-') // and (l_MenuItem <> MenuItem_Copy_WinInfoStyleVerbose) and (l_MenuItem <> MenuItem_Copy_All) // and (l_MenuItem <> MenuItem_Copy_OptUnicode) then begin ComboBox_Copy_FmtSel.Items.Add(MenuItem_Copy.Items[i].Caption); end; end; end; ComboBox_Copy_FmtSel.ItemIndex := 0; Tag := 1; end; procedure TForm_Custom_Copy.FormClose(Sender: TObject; var Action: TCloseAction); begin Action := caFree; end; procedure TForm_Custom_Copy.actFile_CloseExecute(Sender: TObject); //閉じる begin G_CustomForm.actFile_CloseExecute(nil); // Close; end; procedure TForm_Custom_Copy.FormMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); var li_Add: Integer; begin if (gfnbKeyState(VK_SHIFT)) then begin li_Add := 10; end else begin li_Add := 1; end; if (WheelDelta > 0) then begin li_Add := -(li_Add); end; if (ScrollBox_Copy.Focused) then begin ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + li_Add * 10; end; end; procedure TForm_Custom_Copy.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin case Key of VK_PRIOR: begin ComboBox_Copy_FmtSel.ItemIndex := gfniNumLimit(ComboBox_Copy_FmtSel.ItemIndex -1, 0, ComboBox_Copy_FmtSel.Items.Count-1); ComboBox_Copy_FmtSelSelect(nil); Key := 0; end; VK_NEXT: begin ComboBox_Copy_FmtSel.ItemIndex := gfniNumLimit(ComboBox_Copy_FmtSel.ItemIndex +1, 0, ComboBox_Copy_FmtSel.Items.Count-1); ComboBox_Copy_FmtSelSelect(nil); Key := 0; end; end; end; procedure TForm_Custom_Copy.pnlCopy_WinInfoPIDClick(Sender: TObject); begin ScrollBox_Copy.SetFocus; end; //------------------------------------------------------------------------------ //コピー procedure TForm_Custom_Copy.ComboBox_Copy_FmtSelSelect(Sender: TObject); procedure lpc_SetFocus(AControl: TWinControl); var i: Integer; begin if (Self.Visible) then begin // AControl.SetFocus; for i := 0 to AControl.ControlCount-1 do begin if (AControl.Controls[i] is TWinControl) and (TWinControl(AControl.Controls[i]).TabOrder = 0) then begin TWinControl(AControl.Controls[i]).SetFocus; end; end; end; end; begin with App_BugsEye do begin if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_Picture.Caption) then begin //ズーム画像 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_Zoom.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_Zoom); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorRGB.Caption) then begin //カラー情報/RGB ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorRGB.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorRGB); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorRGBRed.Caption) then begin //カラー情報/RGB - 赤 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorRGBRed.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorRGBRed); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorRGBGreen.Caption) then begin //カラー情報/RGB - 緑 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorRGBGreen.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorRGBGreen); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorRGBBlue.Caption) then begin //カラー情報/RGB - 青 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorRGBBlue.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorRGBBlue); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorHTML.Caption) then begin //カラー情報/HTML ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorHTML.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorHTML); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorCOLORREF.Caption) then begin //カラー情報/COLORREF ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorCOLORREF.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorCOLORREF); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorHSV.Caption) then begin //カラー情報/HSV ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorHSV.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorHSV); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorHLS.Caption) then begin //カラー情報/HLS ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorHLS.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorHLS); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_ColorHLSWin.Caption) then begin //カラー情報/HLS Windows ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_ColorHLSWin.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_ColorHLSWin); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_PosScreen.Caption) then begin //カーソル位置/スクリーン座標 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_PosScreen.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_PosScreen); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_PosMonitor.Caption) then begin //カーソル位置/モニター座標 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_PosMonitor.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_PosMonitor); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_PosClient.Caption) then begin //カーソル位置/クライアント座標 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_PosClient.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_PosClient); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_PosUser.Caption) then begin //カーソル位置/ユーザー指定座標 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_PosUser.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_PosUser); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoHandle.Caption) then begin //ウィンドウ情報/ハンドル ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoHandle.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoHandle); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoClassName.Caption) then begin //ウィンドウ情報/クラス名 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoClassName.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoClassName); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoText.Caption) then begin //ウィンドウ情報/テキスト ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoText.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoText); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoWindowSize.Caption) then begin //ウィンドウ情報/ウィンドウサイズ ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoWindowSize.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoWindowSize); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoClientSize.Caption) then begin //ウィンドウ情報/クライアントサイズ ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoClientSize.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoClientSize); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoRECT.Caption) then begin //ウィンドウ情報/RECT ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoRect.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoRect); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoControlID.Caption) then begin //ウィンドウ情報/コントロールID ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoControlID.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoControlID); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoStyle.Caption) then begin //ウィンドウ情報/ウィンドウスタイル ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoStyle.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoStyle); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoStyleEx.Caption) then begin //ウィンドウ情報/拡張ウィンドウスタイル ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoStyleEx.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoStyleEx); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoPID.Caption) then begin //ウィンドウ情報/プロセスID ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoPID.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoPID); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoExeName.Caption) then begin //ウィンドウ情報/実行ファイル名 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoExeName.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoExeName); end else if (ComboBox_Copy_FmtSel.Text = MenuItem_Copy_WinInfoFileVersion.Caption) then begin //ウィンドウ情報/実行ファイル名 ScrollBox_Copy.VertScrollBar.Position := ScrollBox_Copy.VertScrollBar.Position + pnlCopy_WinInfoFileVersion.Top; if (Sender = nil) then lpc_SetFocus(pnlCopy_WinInfoFileVersion); end; end; end; procedure TForm_Custom_Copy.ComboBox_Copy_FmtSelKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin // ComboBox_Copy_FmtSelSelect(nil); end; function TForm_Custom_Copy.F_GetTrueFalse(sValue: String): Boolean; begin Result := (sValue <> '0'); end; function TForm_Custom_Copy.F_GetTrueFalse(bChecked: Boolean): String; begin if (bChecked) then begin Result := '1'; end else begin Result := '0'; end; end; function TForm_Custom_Copy.F_GetCategoryMsg(AMenuItem: TMenuItem): String; var l_Action: TAction; begin Result := Format('%s'#13, [StripHotKey(AMenuItem.Caption)]); l_Action := TAction(AMenuItem.Action); if (l_Action <> nil) then begin Result := Format('%s/%s', [l_Action.Category, Result]); end; end; procedure TForm_Custom_Copy.actCopy_ResetAllExecute(Sender: TObject); begin //コピー形式の設定をすべてリセット if (gfniMessageBoxYesNo(G_csCustomCopy_ResetAllMessage, G_csAPPTITLE) = ID_YES) then begin //それぞれの引数はnilでなければ初期化する actCopy_ZoomResetExecute(Self); actCopy_ColorRGBResetExecute(Self); actCopy_ColorRGBRedResetExecute(Self); actCopy_ColorRGBGreenResetExecute(Self); actCopy_ColorRGBBlueResetExecute(Self); actCopy_ColorHTMLResetExecute(Self); actCopy_ColorCOLORREFResetExecute(Self); actCopy_ColorHSVResetExecute(Self); actCopy_ColorHLSResetExecute(Self); actCopy_ColorHLSWinResetExecute(Self); actCopy_PosScreenResetExecute(Self); actCopy_PosMonitorResetExecute(Self); actCopy_PosClientResetExecute(Self); actCopy_PosUserResetExecute(Self); actCopy_WinInfoHandleResetExecute(Self); actCopy_WinInfoClassNameResetExecute(Self); actCopy_WinInfoTextResetExecute(Self); actCopy_WinInfoWindowSizeResetExecute(Self); actCopy_WinInfoClientSizeResetExecute(Self); actCopy_WinInfoRectResetExecute(Self); actCopy_WinInfoControlIDResetExecute(Self); actCopy_WinInfoStyleResetExecute(Self); actCopy_WinInfoStyleExResetExecute(Self); actCopy_WinInfoPIDResetExecute(Self); actCopy_WinInfoExeNameResetExecute(Self); actCopy_WinInfoFileVersionResetExecute(Self); end; end; //コピー/ズーム画像、リセット procedure TForm_Custom_Copy.actCopy_ZoomResetExecute(Sender: TObject); begin with App_BugsEye do begin if (Sender = nil) then begin //変換 chkCopy_ZoomGrid.Checked := CopyZoomGrid; chkCopy_ZoomInfo.Checked := CopyZoomInfo; end else begin //初期化 chkCopy_ZoomGrid.Checked := InitCopyZoomGrid; chkCopy_ZoomInfo.Checked := InitCopyZoomInfo; end; chkCopy_ZoomGridClick(chkCopy_ZoomGrid); chkCopy_ZoomGridClick(chkCopy_ZoomInfo); end; end; procedure TForm_Custom_Copy.chkCopy_ZoomGridClick(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTZOOM] := F_GetTrueFalse(chkCopy_ZoomGrid.Checked) + F_GetTrueFalse(chkCopy_ZoomInfo.Checked); end; end; //COLOR RGB procedure TForm_Custom_Copy.actCopy_ColorRGBResetExecute(Sender: TObject); var ls_Fmt, ls_Type, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTCOLOR_RGB] := InitCopyFmt[G_ciFMTCOLOR_RGB]; end; ls_Fmt := CopyFmt[G_ciFMTCOLOR_RGB]; try edtCopy_ColorRGB1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); edtCopy_ColorRGB2.Text := G_fnsFormatField(ls_Fmt, ['%d', '%x']); edtCopy_ColorRGB3.Text := G_fnsFormatField(ls_Fmt, ['%d', '%x']); edtCopy_ColorRGB4.Text := G_fnsFormatField(ls_Fmt, ['%d', '%x']); chkCopy_ColorRGBHex.Checked := (LowerCase(ls_Type) = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_ColorRGB); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_ColorRGBResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(Format('%s/%s', [ls_Category + Err.Message])); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorRGB1Change(Sender: TObject); var ls_Type: String; begin with App_BugsEye do begin if (chkCopy_ColorRGBHex.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[G_ciFMTCOLOR_RGB] := StringReplace(edtCopy_ColorRGB1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(edtCopy_ColorRGB2.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(edtCopy_ColorRGB3.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(edtCopy_ColorRGB4.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_ColorRGBDisp.Caption := Format(CopyFmt[G_ciFMTCOLOR_RGB], [ StrToInt(lblCopy_ColorRGB_Red.Caption) ,StrToInt(lblCopy_ColorRGB_Green.Caption) ,StrToInt(lblCopy_ColorRGB_Blue.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_ColorRGBRedResetExecute(Sender: TObject); var ls_Fmt, ls_Type, ls_Category: String; li_Index: Integer; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; l_MenuItem: TMenuItem; l_Action: TAction; begin with App_BugsEye do begin li_Index := G_ciFMTCOLOR_RGBRED; l_Edit1 := edtCopy_ColorRGBRed1; l_Edit2 := edtCopy_ColorRGBRed2; l_CheckBox := chkCopy_ColorRGBRedHex; l_MenuItem := MenuItem_Copy_ColorRGBRed; l_Action := actCopy_ColorRGBRedReset; if (Sender <> nil) then begin //初期化 CopyFmt[li_Index] := InitCopyFmt[li_Index]; end; ls_Fmt := CopyFmt[li_Index]; try l_Edit1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); l_Edit2.Text := G_fnsFormatField(ls_Fmt); l_CheckBox.Checked := (ls_Type = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(l_MenuItem); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); l_Action.OnExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorRGBRed1Change(Sender: TObject); var ls_Type: String; li_Index: Integer; l_DispLabel, l_ValueLabel: TLabel; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; begin li_Index := G_ciFMTCOLOR_RGBRED; l_ValueLabel := lblCopy_ColorRGBRed; l_DispLabel := lblCopy_ColorRGBRedDisp; l_Edit1 := edtCopy_ColorRGBRed1; l_Edit2 := edtCopy_ColorRGBRed2; l_CheckBox := chkCopy_ColorRGBRedHex; with App_BugsEye do begin if (l_CheckBox.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[li_Index] := StringReplace(l_Edit1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(l_Edit2.Text, '%', '%%', [rfReplaceAll]) ; l_DispLabel.Caption := Format(CopyFmt[li_Index], [ StrToInt(l_ValueLabel.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_ColorRGBGreenResetExecute(Sender: TObject); var ls_Fmt, ls_Type, ls_Category: String; li_Index: Integer; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; l_MenuItem: TMenuItem; l_Action: TAction; begin with App_BugsEye do begin li_Index := G_ciFMTCOLOR_RGBGREEN; l_Edit1 := edtCopy_ColorRGBGreen1; l_Edit2 := edtCopy_ColorRGBGreen2; l_CheckBox := chkCopy_ColorRGBGreenHex; l_MenuItem := MenuItem_Copy_ColorRGBGreen; l_Action := actCopy_ColorRGBGreenReset; if (Sender <> nil) then begin //初期化 CopyFmt[li_Index] := InitCopyFmt[li_Index]; end; ls_Fmt := CopyFmt[li_Index]; try l_Edit1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); l_Edit2.Text := G_fnsFormatField(ls_Fmt); l_CheckBox.Checked := (ls_Type = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(l_MenuItem); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); l_Action.OnExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorRGBGreen1Change(Sender: TObject); var li_Index: Integer; l_DispLabel, l_ValueLabel: TLabel; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; ls_Type: String; begin li_Index := G_ciFMTCOLOR_RGBGREEN; l_ValueLabel := lblCopy_ColorRGBGreen; l_DispLabel := lblCopy_ColorRGBGreenDisp; l_Edit1 := edtCopy_ColorRGBGreen1; l_Edit2 := edtCopy_ColorRGBGreen2; l_CheckBox := chkCopy_ColorRGBGreenHex; with App_BugsEye do begin if (l_CheckBox.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[li_Index] := StringReplace(l_Edit1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(l_Edit2.Text, '%', '%%', [rfReplaceAll]) ; l_DispLabel.Caption := Format(CopyFmt[li_Index], [ StrToInt(l_ValueLabel.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_ColorRGBBlueResetExecute(Sender: TObject); var ls_Fmt, ls_Type, ls_Category: String; li_Index: Integer; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; l_MenuItem: TMenuItem; l_Action: TAction; begin with App_BugsEye do begin li_Index := G_ciFMTCOLOR_RGBBLUE; l_Edit1 := edtCopy_ColorRGBBlue1; l_Edit2 := edtCopy_ColorRGBBlue2; l_CheckBox := chkCopy_ColorRGBBlueHex; l_MenuItem := MenuItem_Copy_ColorRGBBlue; l_Action := actCopy_ColorRGBBlueReset; if (Sender <> nil) then begin //初期化 CopyFmt[li_Index] := InitCopyFmt[li_Index]; end; ls_Fmt := CopyFmt[li_Index]; try l_Edit1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); l_Edit2.Text := G_fnsFormatField(ls_Fmt); l_CheckBox.Checked := (ls_Type = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(l_MenuItem); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); l_Action.OnExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorRGBBlue1Change(Sender: TObject); var li_Index: Integer; l_DispLabel, l_ValueLabel: TLabel; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; ls_Type: String; begin li_Index := G_ciFMTCOLOR_RGBBLUE; l_ValueLabel := lblCopy_ColorRGBBlue; l_DispLabel := lblCopy_ColorRGBBlueDisp; l_Edit1 := edtCopy_ColorRGBBlue1; l_Edit2 := edtCopy_ColorRGBBlue2; l_CheckBox := chkCopy_ColorRGBBlueHex; with App_BugsEye do begin if (l_CheckBox.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[li_Index] := StringReplace(l_Edit1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(l_Edit2.Text, '%', '%%', [rfReplaceAll]) ; l_DispLabel.Caption := Format(CopyFmt[li_Index], [ StrToInt(l_ValueLabel.Caption) ]); end; end; //Color HTML const lcsCOPYFMT_HTML = '%.6x'; procedure TForm_Custom_Copy.actCopy_ColorHTMLResetExecute(Sender: TObject); //カラー情報/HTML var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTCOLOR_HTML] := InitCopyFmt[G_ciFMTCOLOR_HTML]; end; ls_Fmt := CopyFmt[G_ciFMTCOLOR_HTML]; try edtCopy_ColorHTML1.Text := G_fnsFormatField(ls_Fmt, [lcsCOPYFMT_HTML]); edtCopy_ColorHTML2.Text := G_fnsFormatField(ls_Fmt, [lcsCOPYFMT_HTML]); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_ColorHTML); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_ColorHTMLResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorHTML1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTCOLOR_HTML] := StringReplace(edtCopy_ColorHTML1.Text, '%', '%%', [rfReplaceAll]) + lcsCOPYFMT_HTML + StringReplace(edtCopy_ColorHTML2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_ColorHTMLDisp.Caption := Format(CopyFmt[G_ciFMTCOLOR_HTML], [ StrToInt('$' + lblCopy_ColorHTML.Caption) ]); end; end; //Color COLORREF const lcsCOPYFMT_COLORREF_10 = '%d'; lcsCOPYFMT_COLORREF_16 = '%.6x'; procedure TForm_Custom_Copy.actCopy_ColorCOLORREFResetExecute(Sender: TObject); //カラー情報/COLORREF var ls_Fmt, ls_Type, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTCOLOR_COLORREF] := InitCopyFmt[G_ciFMTCOLOR_COLORREF]; end; ls_Fmt := CopyFmt[G_ciFMTCOLOR_COLORREF]; try edtCopy_ColorCOLORREF1.Text := G_fnsFormatField(ls_Fmt, ls_Type, [lcsCOPYFMT_COLORREF_10, lcsCOPYFMT_COLORREF_16]); edtCopy_ColorCOLORREF2.Text := G_fnsFormatField(ls_Fmt); chkCopy_ColorCOLORREFHex.Checked := (ls_Type = lcsCOPYFMT_COLORREF_16); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_ColorCOLORREF); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_ColorCOLORREFResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorCOLORREF1Change(Sender: TObject); var ls_Type: String; begin with App_BugsEye do begin if (chkCopy_ColorCOLORREFHex.Checked) then begin ls_Type := lcsCOPYFMT_COLORREF_16; end else begin ls_Type := lcsCOPYFMT_COLORREF_10; end; CopyFmt[G_ciFMTCOLOR_COLORREF] := StringReplace(edtCopy_ColorCOLORREF1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(edtCopy_ColorCOLORREF2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_ColorCOLORREFDisp.Caption := Format(CopyFmt[G_ciFMTCOLOR_COLORREF], [ StrToInt(lblCopy_ColorCOLORREF.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_ColorHSVResetExecute(Sender: TObject); //カラー情報/HSV var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTCOLOR_HSV] := InitCopyFmt[G_ciFMTCOLOR_HSV]; end; ls_Fmt := CopyFmt[G_ciFMTCOLOR_HSV]; try edtCopy_ColorHSV1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHSV2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHSV3.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHSV4.Text := G_fnsFormatField(ls_Fmt, ['%d']); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_ColorHSV); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_ColorHSVResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorHSV1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTCOLOR_HSV] := StringReplace(edtCopy_ColorHSV1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHSV2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHSV3.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHSV4.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_ColorHSVDisp.Caption := Format(CopyFmt[G_ciFMTCOLOR_HSV], [ StrToInt(lblCopy_ColorHSVHue.Caption) ,StrToInt(lblCopy_ColorHSVSaturation.Caption) ,StrToInt(lblCopy_ColorHSVValue.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_ColorHLSResetExecute(Sender: TObject); //カラー情報/HLS var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTCOLOR_HLS] := InitCopyFmt[G_ciFMTCOLOR_HLS]; end; ls_Fmt := CopyFmt[G_ciFMTCOLOR_HLS]; try edtCopy_ColorHLS1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHLS2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHLS3.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHLS4.Text := G_fnsFormatField(ls_Fmt, ['%d']); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_ColorHLS); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_ColorHLSResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorHLS1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTCOLOR_HLS] := StringReplace(edtCopy_ColorHLS1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHLS2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHLS3.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHLS4.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_ColorHLSDisp.Caption := Format(CopyFmt[G_ciFMTCOLOR_HLS], [ StrToInt(lblCopy_ColorHLSHue.Caption) ,StrToInt(lblCopy_ColorHLSSaturation.Caption) ,StrToInt(lblCopy_ColorHLSLightness.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_ColorHLSWinResetExecute(Sender: TObject); //カラー情報/HLS Windows var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTCOLOR_HLSWIN] := InitCopyFmt[G_ciFMTCOLOR_HLSWIN]; end; ls_Fmt := CopyFmt[G_ciFMTCOLOR_HLSWIN]; try edtCopy_ColorHLSWin1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHLSWin2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHLSWin3.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_ColorHLSWin4.Text := G_fnsFormatField(ls_Fmt, ['%d']); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_ColorHLSWin); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_ColorHLSWinResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_ColorHLSWin1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTCOLOR_HLSWIN] := StringReplace(edtCopy_ColorHLSWin1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHLSWin2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHLSWin3.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_ColorHLSWin4.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_ColorHLSWinDisp.Caption := Format(CopyFmt[G_ciFMTCOLOR_HLSWIN], [ StrToInt(lblCopy_ColorHLSWinHue.Caption) ,StrToInt(lblCopy_ColorHLSWinSaturation.Caption) ,StrToInt(lblCopy_ColorHLSWinLightness.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_PosScreenResetExecute(Sender: TObject); //スクリーン座標 var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTPOS_SCREEN] := InitCopyFmt[G_ciFMTPOS_SCREEN]; end; ls_Fmt := CopyFmt[G_ciFMTPOS_SCREEN]; try edtCopy_PosScreen1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_PosScreen2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_PosScreen3.Text := G_fnsFormatField(ls_Fmt, ['%d']); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_PosScreen); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_PosScreenResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_PosScreen1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTPOS_SCREEN] := StringReplace(edtCopy_PosScreen1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosScreen2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosScreen3.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_PosScreenDisp.Caption := Format(CopyFmt[G_ciFMTPOS_SCREEN], [ StrToInt(lblCopy_PosScreenX.Caption) ,StrToInt(lblCopy_PosScreenY.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_PosMonitorResetExecute(Sender: TObject); //モニター座標 var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTPOS_MONITOR] := InitCopyFmt[G_ciFMTPOS_MONITOR]; end; ls_Fmt := CopyFmt[G_ciFMTPOS_MONITOR]; try edtCopy_PosMonitor1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_PosMonitor2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_PosMonitor3.Text := G_fnsFormatField(ls_Fmt, ['%d']); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_PosMonitor); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_PosMonitorResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_PosMonitor1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTPOS_MONITOR] := StringReplace(edtCopy_PosMonitor1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosMonitor2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosMonitor3.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_PosMonitorDisp.Caption := Format(CopyFmt[G_ciFMTPOS_MONITOR], [ StrToInt(lblCopy_PosMonitorX.Caption), StrToInt(lblCopy_PosMonitorY.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_PosClientResetExecute(Sender: TObject); //Pos Client var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTPOS_CLIENT] := InitCopyFmt[G_ciFMTPOS_CLIENT]; end; ls_Fmt := CopyFmt[G_ciFMTPOS_CLIENT]; try edtCopy_PosClient1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_PosClient2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_PosClient3.Text := G_fnsFormatField(ls_Fmt, ['%d']); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_PosClient); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_PosClientResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_PosClient1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTPOS_CLIENT] := StringReplace(edtCopy_PosClient1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosClient2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosClient3.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_PosClientDisp.Caption := Format(CopyFmt[G_ciFMTPOS_CLIENT], [ StrToInt(lblCopy_PosClientX.Caption) ,StrToInt(lblCopy_PosClientY.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_PosUserResetExecute(Sender: TObject); //PosUser var ls_Fmt, ls_FmtOrigin, ls_Type, ls_Temp, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTPOS_LENGTH] := InitCopyFmt[G_ciFMTPOS_LENGTH]; CopyFmt[G_ciFMTPOS_LENGTHORIGIN] := InitCopyFmt[G_ciFMTPOS_LENGTHORIGIN]; end; ls_Fmt := CopyFmt[G_ciFMTPOS_LENGTH]; ls_FmtOrigin := CopyFmt[G_ciFMTPOS_LENGTHORIGIN]; try edtCopy_PosUser3.Text := G_fnsFormatField(ls_FmtOrigin, ['%d']); edtCopy_PosUser4.Text := G_fnsFormatField(ls_FmtOrigin, ['%d']); edtCopy_PosUser1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_PosUser2.Text := G_fnsFormatField(ls_Fmt, ['%d']); ls_Temp := G_fnsFormatField(ls_Fmt, ls_Type, ['%d']); //原点ありかなしかのチェックとUser5を取り出すために必要 chkCopy_PosUserOrigin.Checked := (ls_Type = '%d'); if (chkCopy_PosUserOrigin.Checked) then begin //原点あり ls_Temp := G_fnsFormatField(ls_Fmt); //↓を取り出すためにだけ必要 edtCopy_PosUser5.Text := G_fnsFormatField(ls_Fmt); //編集可 edtCopy_PosUser3.Color := clWindow; end else begin //原点なし edtCopy_PosUser5.Text := ls_Temp; //編集不可 edtCopy_PosUser3.Color := clBtnFace; end; lblCopy_PosUserOriginX.Enabled := chkCopy_PosUserOrigin.Checked; lblCopy_PosUserOriginY.Enabled := lblCopy_PosUserOriginX.Enabled; edtCopy_PosUser3.Enabled := lblCopy_PosUserOriginX.Enabled; edtCopy_PosUser4.Enabled := lblCopy_PosUserOriginX.Enabled; edtCopy_PosUser4.Color := edtCopy_PosUser3.Color; except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_PosUser); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_PosUserResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_PosUser1Change(Sender: TObject); begin with App_BugsEye do begin if (chkCopy_PosUserOrigin.Checked) then begin CopyFmt[G_ciFMTPOS_LENGTH] := StringReplace(edtCopy_PosUser1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosUser2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosUser3.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosUser4.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosUser5.Text, '%', '%%', [rfReplaceAll]) ; edtCopy_PosUser3.Color := clWindow; end else begin CopyFmt[G_ciFMTPOS_LENGTH] := StringReplace(edtCopy_PosUser1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosUser2.Text, '%', '%%', [rfReplaceAll]) + '%d' // + StringReplace(edtCopy_PosUser3.Text, '%', '%%', [rfReplaceAll]) // + '%d' // + StringReplace(edtCopy_PosUser4.Text, '%', '%%', [rfReplaceAll]) // + '%d' + StringReplace(edtCopy_PosUser5.Text, '%', '%%', [rfReplaceAll]) ; edtCopy_PosUser3.Color := clBtnFace; end; lblCopy_PosUserOriginX.Enabled := chkCopy_PosUserOrigin.Checked; lblCopy_PosUserOriginY.Enabled := lblCopy_PosUserOriginX.Enabled; edtCopy_PosUser3.Enabled := lblCopy_PosUserOriginX.Enabled; edtCopy_PosUser4.Enabled := lblCopy_PosUserOriginX.Enabled; edtCopy_PosUser4.Color := edtCopy_PosUser3.Color; //変換には直接使われないが原点ありのフォーマットの保存のため必要 CopyFmt[G_ciFMTPOS_LENGTHORIGIN] := StringReplace(edtCopy_PosUser3.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_PosUser4.Text, '%', '%%', [rfReplaceAll]) + '%d' ; lblCopy_PosUserDisp.Caption := Format(CopyFmt[G_ciFMTPOS_LENGTH], [ StrToInt(lblCopy_PosUserX.Caption) ,StrToInt(lblCopy_PosUserY.Caption) ,StrToInt(lblCopy_PosUserOriginX.Caption) ,StrToInt(lblCopy_PosUserOriginY.Caption) ]); end; end; //ウィンドウ情報 procedure TForm_Custom_Copy.actCopy_WinInfoHandleResetExecute(Sender: TObject); //ウィンドウハンドル var ls_Fmt, ls_Type, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_HANDLE] := InitCopyFmt[G_ciFMTWININFO_HANDLE]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_HANDLE]; try edtCopy_WinInfoHandle1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); edtCopy_WinInfoHandle2.Text := G_fnsFormatField(ls_Fmt); chkCopy_WinInfoHandleHex.Checked := (ls_Type = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoHandle); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoHandleResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoHandle1Change(Sender: TObject); var ls_Type: String; begin with App_BugsEye do begin if (chkCopy_WinInfoHandleHex.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[G_ciFMTWININFO_HANDLE] := StringReplace(edtCopy_WinInfoHandle1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(edtCopy_WinInfoHandle2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoHandleDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_HANDLE], [ StrToInt(lblCopy_WinInfoHandle.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoClassNameResetExecute(Sender: TObject); //クラス名 var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_CLASSNAME] := InitCopyFmt[G_ciFMTWININFO_CLASSNAME]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_CLASSNAME]; try edtCopy_WinInfoClassName1.Text := G_fnsFormatField(ls_Fmt, ['%s']); edtCopy_WinInfoClassName2.Text := G_fnsFormatField(ls_Fmt); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoClassName); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoClassNameResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoClassName1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTWININFO_CLASSNAME] := StringReplace(edtCopy_WinInfoClassName1.Text, '%', '%%', [rfReplaceAll]) + '%s' + StringReplace(edtCopy_WinInfoClassName2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoClassNameDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_CLASSNAME], [ lblCopy_WinInfoClassName.Caption ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoTextResetExecute(Sender: TObject); //ウィンドウテキスト var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_TEXT] := InitCopyFmt[G_ciFMTWININFO_TEXT]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_TEXT]; try edtCopy_WinInfoText1.Text := G_fnsFormatField(ls_Fmt, ['%s']); edtCopy_WinInfoText2.Text := G_fnsFormatField(ls_Fmt); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoText); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoTextResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoText1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTWININFO_TEXT] := StringReplace(edtCopy_WinInfoText1.Text, '%', '%%', [rfReplaceAll]) + '%s' + StringReplace(edtCopy_WinInfoText2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoTextDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_TEXT], [ lblCopy_WinInfoText.Caption ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoWindowSizeResetExecute(Sender: TObject); //ウィンドウサイズ var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_WINDOWSIZE] := InitCopyFmt[G_ciFMTWININFO_WINDOWSIZE]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_WINDOWSIZE]; try edtCopy_WinInfoWindowSize1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoWindowSize2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoWindowSize3.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoWindowSize4.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoWindowSize5.Text := G_fnsFormatField(ls_Fmt); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoWindowSize); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoWindowSizeResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoWindowSize1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTWININFO_WINDOWSIZE] := StringReplace(edtCopy_WinInfoWindowSize1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoWindowSize2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoWindowSize3.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoWindowSize4.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoWindowSize5.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoWindowSizeDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_WINDOWSIZE], [ StrToInt(lblCopy_WinInfoWindowSizeLeft.Caption) ,StrToInt(lblCopy_WinInfoWindowSizeTop.Caption) ,StrToInt(lblCopy_WinInfoWindowSizeWidth.Caption) ,StrToInt(lblCopy_WinInfoWindowSizeHeight.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoClientSizeResetExecute(Sender: TObject); //クライアントサイズ var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_CLIENTSIZE] := InitCopyFmt[G_ciFMTWININFO_CLIENTSIZE]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_CLIENTSIZE]; try //Str1%4:sStr2%5:sStr3%2:dStr4%3:dStr5 //Str1%0:dStr2%1:dStr3%2:dStr4%3:dStr5 edtCopy_WinInfoClientSize1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoClientSize2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoClientSize3.Text := G_fnsFormatField(ls_Fmt); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoClientSize); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoClientSizeResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoClientSize1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTWININFO_CLIENTSIZE] := StringReplace(edtCopy_WinInfoClientSize1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoClientSize2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoClientSize3.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoClientSizeDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_CLIENTSIZE], [ StrToInt(lblCopy_WinInfoClientSizeWidth.Caption) ,StrToInt(lblCopy_WinInfoClientSizeHeight.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoRectResetExecute(Sender: TObject); //RECT var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_RECT] := InitCopyFmt[G_ciFMTWININFO_RECT]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_RECT]; try //Str1%4:sStr2%5:sStr3%2:dStr4%3:dStr5 //Str1%0:dStr2%1:dStr3%2:dStr4%3:dStr5 edtCopy_WinInfoRECT1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoRECT2.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoRECT3.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoRECT4.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoRECT5.Text := G_fnsFormatField(ls_Fmt); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoRect); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoRectResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoRect1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTWININFO_RECT] := StringReplace(edtCopy_WinInfoRECT1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoRECT2.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoRECT3.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoRECT4.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoRECT5.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoRECTDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_RECT], [ StrToInt(lblCopy_WinInfoRECTLeft.Caption) ,StrToInt(lblCopy_WinInfoRECTTop.Caption) ,StrToInt(lblCopy_WinInfoRECTRight.Caption) ,StrToInt(lblCopy_WinInfoRECTBottom.Caption) ]); end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoControlIDEdit1Change(Sender: TObject); //コントロールID begin with App_BugsEye do begin CopyFmt[G_ciFMTWININFO_CONTROLID] := StringReplace(edtCopy_WinInfoControlIDEdit1.Text, '%', '%%', [rfReplaceAll]) + '%d' + StringReplace(edtCopy_WinInfoControlIDEdit2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoControlIDDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_CONTROLID], [ StrToInt(lblCopy_WinInfoControlIDValue.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoControlIDResetExecute(Sender: TObject); var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_CONTROLID] := InitCopyFmt[G_ciFMTWININFO_CONTROLID]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_CONTROLID]; try //Str1%dStr2 edtCopy_WinInfoControlIDEdit1.Text := G_fnsFormatField(ls_Fmt, ['%d']); edtCopy_WinInfoControlIDEdit2.Text := G_fnsFormatField(ls_Fmt); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoControlID); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoControlIDResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.actCopy_WinInfoStyleResetExecute(Sender: TObject); //ウィンドウスタイル var ls_Fmt, ls_Type, ls_Category: String; li_Index: Integer; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; l_MenuItem: TMenuItem; l_Action: TAction; begin with App_BugsEye do begin li_Index := G_ciFMTWININFO_STYLE; l_Edit1 := edtCopy_WinInfoStyle1; l_Edit2 := edtCopy_WinInfoStyle2; l_CheckBox := chkCopy_WinInfoStyleHex; l_MenuItem := MenuItem_Copy_WinInfoStyle; l_Action := actCopy_WinInfoStyleReset; if (Sender <> nil) then begin //初期化 CopyFmt[li_Index] := InitCopyFmt[li_Index]; end; ls_Fmt := CopyFmt[li_Index]; try l_Edit1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); l_Edit2.Text := G_fnsFormatField(ls_Fmt); l_CheckBox.Checked := (ls_Type = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(l_MenuItem); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); l_Action.OnExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoStyle1Change(Sender: TObject); var li_Index: Integer; l_DispLabel, l_ValueLabel: TLabel; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; ls_Type: String; begin li_Index := G_ciFMTWININFO_STYLE; l_ValueLabel := lblCopy_WinInfoStyle; l_DispLabel := lblCopy_WinInfoStyleDisp; l_Edit1 := edtCopy_WinInfoStyle1; l_Edit2 := edtCopy_WinInfoStyle2; l_CheckBox := chkCopy_WinInfoStyleHex; with App_BugsEye do begin if (l_CheckBox.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[li_Index] := StringReplace(l_Edit1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(l_Edit2.Text, '%', '%%', [rfReplaceAll]) ; l_DispLabel.Caption := Format(CopyFmt[li_Index], [ StrToInt(l_ValueLabel.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoStyleExResetExecute(Sender: TObject); var ls_Fmt, ls_Type, ls_Category: String; li_Index: Integer; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; l_MenuItem: TMenuItem; l_Action: TAction; begin with App_BugsEye do begin li_Index := G_ciFMTWININFO_STYLEEX; l_Edit1 := edtCopy_WinInfoStyleEx1; l_Edit2 := edtCopy_WinInfoStyleEx2; l_CheckBox := chkCopy_WinInfoStyleExHex; l_MenuItem := MenuItem_Copy_WinInfoStyleEx; l_Action := actCopy_WinInfoStyleExReset; if (Sender <> nil) then begin //初期化 CopyFmt[li_Index] := InitCopyFmt[li_Index]; end; ls_Fmt := CopyFmt[li_Index]; try l_Edit1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); l_Edit2.Text := G_fnsFormatField(ls_Fmt); l_CheckBox.Checked := (ls_Type = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(l_MenuItem); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); l_Action.OnExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoStyleEx1Change(Sender: TObject); var li_Index: Integer; l_DispLabel, l_ValueLabel: TLabel; l_Edit1, l_Edit2: TEdit; l_CheckBox: TCheckBox; ls_Type: String; begin li_Index := G_ciFMTWININFO_STYLEEX; l_ValueLabel := lblCopy_WinInfoStyleEx; l_DispLabel := lblCopy_WinInfoStyleExDisp; l_Edit1 := edtCopy_WinInfoStyleEx1; l_Edit2 := edtCopy_WinInfoStyleEx2; l_CheckBox := chkCopy_WinInfoStyleExHex; with App_BugsEye do begin if (l_CheckBox.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[li_Index] := StringReplace(l_Edit1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(l_Edit2.Text, '%', '%%', [rfReplaceAll]) ; l_DispLabel.Caption := Format(CopyFmt[li_Index], [ StrToInt(l_ValueLabel.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoPIDResetExecute(Sender: TObject); //PID var ls_Fmt, ls_Type, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_PID] := InitCopyFmt[G_ciFMTWININFO_PID]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_PID]; try edtCopy_WinInfoPID1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%d', '%x']); edtCopy_WinInfoPID2.Text := G_fnsFormatField(ls_Fmt); chkCopy_WinInfoPIDHex.Checked := (ls_Type = '%x'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoPID); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoPIDResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoPID1Change(Sender: TObject); var ls_Type: String; begin with App_BugsEye do begin if (chkCopy_WinInfoPIDHex.Checked) then begin ls_Type := '%x'; end else begin ls_Type := '%d'; end; CopyFmt[G_ciFMTWININFO_PID] := StringReplace(edtCopy_WinInfoPID1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(edtCopy_WinInfoPID2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoPIDDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_PID], [ StrToInt(lblCopy_WinInfoPID.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoExeNameResetExecute(Sender: TObject); //実行ファイル名 var ls_Fmt, ls_Type, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_EXENAME] := InitCopyFmt[G_ciFMTWININFO_EXENAME]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_EXENAME]; try edtCopy_WinInfoExeName1.Text := G_fnsFormatField(ls_Fmt, ls_Type, ['%0:s', '%1:s']); edtCopy_WinInfoExeName2.Text := G_fnsFormatField(ls_Fmt); chkCopy_WinInfoExeNameFileName.Checked := (ls_Type = '%1:s'); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoExeName); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoExeNameResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoExeName1Change(Sender: TObject); var ls_Type: String; begin with App_BugsEye do begin if (chkCopy_WinInfoExeNameFileName.Checked) then begin ls_Type := '%1:s'; end else begin ls_Type := '%0:s'; end; CopyFmt[G_ciFMTWININFO_EXENAME] := StringReplace(edtCopy_WinInfoExeName1.Text, '%', '%%', [rfReplaceAll]) + ls_Type + StringReplace(edtCopy_WinInfoExeName2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoExeNameDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_EXENAME], [ lblCopy_WinInfoExeName.Caption ,gfnsFileNameGet(lblCopy_WinInfoExeName.Caption) ]); end; end; procedure TForm_Custom_Copy.actCopy_WinInfoFileVersionResetExecute(Sender: TObject); //ファイルバージョン var ls_Fmt, ls_Category: String; begin with App_BugsEye do begin if (Sender <> nil) then begin //初期化 CopyFmt[G_ciFMTWININFO_FILEVERSION] := InitCopyFmt[G_ciFMTWININFO_FILEVERSION]; end; ls_Fmt := CopyFmt[G_ciFMTWININFO_FILEVERSION]; try edtCopy_WinInfoFileVersion1.Text := G_fnsFormatField(ls_Fmt, ['%s']); edtCopy_WinInfoFileVersion2.Text := G_fnsFormatField(ls_Fmt); except on Err: Exception do begin ls_Category := F_GetCategoryMsg(MenuItem_Copy_WinInfoFileVersion); if (Sender = nil) then begin //変換でエラーが起きた⇒データの間違いの可能性あり⇒初期化する // gpcShowMessage(ls_Category + 'コピー形式文字列にエラーがあります'#13'初期値に戻します', 'エラー'); gpcShowMessage(ls_Category + G_csCustomCopy_FmtStrErrMessage); actCopy_WinInfoFileVersionResetExecute(Self); end else begin //初期化でエラーが起きた⇒プログラムコードの間違い raise Exception.Create(ls_Category + Err.Message); end; end; end; end; end; procedure TForm_Custom_Copy.edtCopy_WinInfoFileVersion1Change(Sender: TObject); begin with App_BugsEye do begin CopyFmt[G_ciFMTWININFO_FILEVERSION] := StringReplace(edtCopy_WinInfoFileVersion1.Text, '%', '%%', [rfReplaceAll]) + '%s' + StringReplace(edtCopy_WinInfoFileVersion2.Text, '%', '%%', [rfReplaceAll]) ; lblCopy_WinInfoFileVersionDisp.Caption := Format(CopyFmt[G_ciFMTWININFO_FILEVERSION], [ lblCopy_WinInfoFileVersion.Caption ]); end; end; procedure TForm_Custom_Copy.ComboBox_Copy_FmtSelDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var l_Rect : TRect; begin with ComboBox_Copy_FmtSel do begin Canvas.Font.Assign(Font); l_Rect := Rect; Inc(l_Rect.Left, G_ciTEXT_MARGIN); if (odSelected in State) and (DroppedDown) then begin Canvas.Font.Color := clHighlightText; Canvas.Brush.Color := clHighlight; end else begin Canvas.Font.Color := clWindowText; Canvas.Brush.Color := clWindow; end; Canvas.FillRect(Rect); DrawText(Canvas.Handle, PChar(Items[Index]), -1, l_Rect, DT_NOPREFIX or DT_SINGLELINE or DT_VCENTER); end; end; end.