unit main; //{$DEFINE _DEBUG} //{$DEFINE LANG} //{$DEFINE ERASEBKGND} //{$DEFINE PLUGIN} interface uses Windows, ActnList, AppEvnts, Buttons, Classes, ComCtrls, Controls, Dialogs, ExtCtrls, Forms, Graphics, ImgList, Menus, Messages, StdCtrls, SysUtils, ToolWin, lang, general, winlist; type //「初期化」で必要 T_BugsEyeData = record //設定データ用 iZoomIndex : Integer; //選択されたメニューのインデックス bGridDisp : Boolean; bGridUseSubElseColor : Boolean; iGridIndex : Integer; //選択されたメニューのインデックス iSubGridIndex : Integer; //選択されたメニューのインデックス clGridColor : TColor; //グリッドの色 clGridSubColor : TColor; //サブグリッドの色 clGridSubElseColor : TColor; //サブグリッド2色目 bPos_Screen : Boolean; bPos_Monitor : Boolean; bPos_Client : Boolean; bPos_Length : Boolean; { bPos_LogicalScreen : Boolean; bPos_LogicalMonitor : Boolean; bPos_LogicalClient : Boolean; bPos_LogicalLength : Boolean; } bColor_RGB : Boolean; bColor_HTML : Boolean; bColor_COLORREF : Boolean; bColor_HSV : Boolean; bColor_HLS : Boolean; bColor_HLSWin : Boolean; bWinInfo_Handle : Boolean; bWinInfo_ClassName : Boolean; bWinInfo_Text : Boolean; bWinInfo_WindowSize : Boolean; bWinInfo_ClientSize : Boolean; bWinInfo_Rect : Boolean; bWinInfo_ControlID : Boolean; bWinInfo_Style : Boolean; bWinInfo_Enalbed : Boolean; bWinInfo_ParentWindow : Boolean; bWinInfo_PID : Boolean; bWinInfo_ExeName : Boolean; bWinInfo_FileVersion : Boolean; bWinInfo_StyleVerbose : Boolean; bOpt_StayOnTop : Boolean; bOpt_TitleBar : Boolean; bOpt_ToolBar : Boolean; // bOpt_BigFont : Boolean; bOpt_ZoomWheel : Boolean; // clOpt_BkColor : TColor; //拡大画像の背景色 //以下の二つはオプションへ移動だが互換性のためこのままにする bOpt_NoSelfCapture : Boolean; bOpt_SmoothCapture: Boolean; bCapture_Lupe : Boolean; bCapture_Fixed : Boolean; bCapture_Pause : Boolean; //キャプチャ間隔 iCapture_Interval : Integer; iCapture_SmoothInterval : Integer; iCapture_RefleshTime : Integer; end; type T_DispInfo = record //表示用 //カーソル位置のカラー情報 iRed, iGreen, iBlue : Byte; //RGB用 clColor : TColor; //HTML用 clColorRef : TColor; //COLORREF用 ptMousePos : TPoint; //物理スクリーン座標 ptLengthPos : TPoint; //任意座標の原点 ptClientPos : TPoint; //クライアント座標の原点 ptColorPos : TPoint; //色情報を得る為の位置。カーソルボックスもこの値を利用している hWinHandle: HWND; sWinClass: WideString; sWinText: WideString; szWindowSize, szClientSize: T_MyBounds; rcWinRect: TRect; iControlID, iStyle, iStyleEx: Longint; bEnabled: Boolean; hParentHandle: HWND; sParentClassName: WideString; sParentText: WideString; iProcessID: DWORD; sExeName: WideString; sFileVersion: WideString; clOpt_BkColor : TColor; //拡大画像の背景色 iTest_BrushBkColor : Longint; fpCapture_ZoomFlip : TZoomFlip; //反転・回転 iCapture_Rop : DWORD; //ラスタオペレーション // bsCapture_Brush : TBrushStyle; end; type T_Size = record Width : Integer; Height : Integer; end; T_ZoomBounds = record Center : TPoint; Size : T_Size; end; T_CopyBounds = record Origin : TPoint; Center : TPoint; Size : T_Size; end; T_ZoomSize = record // DispSize : T_Size; //ズーム画像の表示サイズ。 CopySize : T_ZoomBounds; //コピー元のサイズ。 SquareSize : T_CopyBounds; //回転表示があるのでCopySizeの幅と高さの大きい方の正方形。 ZoomSize : T_Size; //CopySize×ズーム倍率。タイマーとコピーの中でのみ使われる。 // ColorPos : TPoint; //カラー値を得る点。 RulerSize : T_Size; //ルーラーのサイズ。 HorizontalGrid : Integer; //グリッドの横線の数。 VerticalGrid : Integer; //グリッドの縦線の数。 end; {$IFDEF PLUGIN} type T_PluginInfo = class(TObject) private FsFileName: WideString; FhWindowHandle: HWND; procedure FSetFileName(sFile: WideString); public constructor Create; property PlugInFile: WideString read FsFileName write FSetFileName; property Handle: HWND read FhWindowHandle write FhWindowHandle; end; {$ENDIF} //http://hsp.tv/play/pforum.php?mode=pastwch&num=49524 const WM_DWMCOMPOSITIONCHANGED = $031E; type TApp_BugsEye = class(TForm) ActionList_Main: TActionList; Action_Zoom_1: TAction; Action_Zoom_2: TAction; Action_Zoom_3: TAction; Action_Zoom_4: TAction; Action_Zoom_6: TAction; Action_Zoom_8: TAction; Action_Zoom_10: TAction; Action_Zoom_12: TAction; Action_Zoom_16: TAction; Action_Zoom_20: TAction; Action_Zoom_Up: TAction; Action_Zoom_Down: TAction; Action_Grid_Disp: TAction; Action_Grid_Gray: TAction; Action_Grid_Black: TAction; Action_Grid_White: TAction; Action_Grid_Invert: TAction; Action_Grid_Transparent: TAction; Action_Grid_SelColor: TAction; Action_Grid_SubNone: TAction; Action_Grid_SubBlue: TAction; Action_Grid_SubRed: TAction; Action_Grid_SelSubColor: TAction; Action_Grid_UseSubElseColor: TAction; Action_Grid_SelSubElseColor: TAction; Action_Color_RGB: TAction; Action_Color_HTML: TAction; Action_Color_COLORREF: TAction; Action_Color_HSV: TAction; Action_Color_HLS: TAction; Action_Color_HLSWin: TAction; Action_Color_InfoOnOff: TAction; Action_Pos_Screen: TAction; Action_Pos_Monitor: TAction; Action_Pos_Client: TAction; Action_Pos_Length: TAction; Action_Pos_LengthPosSet: TAction; Action_Pos_InfoOnOff: TAction; Action_WinInfo_Handle: TAction; Action_WinInfo_ClassName: TAction; Action_WinInfo_Text: TAction; Action_WinInfo_WindowSize: TAction; Action_WinInfo_ClientSize: TAction; Action_WinInfo_Rect: TAction; Action_WinInfo_ControlID: TAction; Action_WinInfo_Enabled: TAction; Action_WinInfo_Style: TAction; Action_WinInfo_ParentWindow: TAction; Action_WinInfo_PID: TAction; Action_WinInfo_ExeName: TAction; Action_WinInfo_FileVersion: TAction; Action_WinInfo_StyleVerbose: TAction; Action_WinInfo_InfoOnOff: TAction; Action_Copy_Picture: TAction; Action_Copy_All: TAction; Action_Copy_ColorHTML: TAction; Action_Copy_ColorRGBRed: TAction; Action_Copy_ColorRGBGreen: TAction; Action_Copy_ColorRGBBlue: TAction; Action_Copy_ColorRGB: TAction; Action_Copy_ColorCOLORREF: TAction; Action_Copy_ColorHSV: TAction; Action_Copy_ColorHSVHue: TAction; Action_Copy_ColorHSVSaturation: TAction; Action_Copy_ColorHSVValue: TAction; Action_Copy_ColorHLS: TAction; Action_Copy_ColorHLSHue: TAction; Action_Copy_ColorHLSSaturation: TAction; Action_Copy_ColorHLSLightness: TAction; Action_Copy_ColorHLSWin: TAction; Action_Copy_ColorHLSWinHue: TAction; Action_Copy_ColorHLSWinSaturation: TAction; Action_Copy_ColorHLSWinLightness: TAction; Action_Copy_PosScreen: TAction; Action_Copy_PosScreenX: TAction; Action_Copy_PosScreenY: TAction; Action_Copy_PosMonitor: TAction; Action_Copy_PosMonitorX: TAction; Action_Copy_PosMonitorY: TAction; Action_Copy_PosClient: TAction; Action_Copy_PosClientX: TAction; Action_Copy_PosClientY: TAction; Action_Copy_PosLength: TAction; Action_Copy_PosLengthWidth: TAction; Action_Copy_PosLengthHeight: TAction; Action_Copy_WinInfoHandle: TAction; Action_Copy_WinInfoClassName: TAction; Action_Copy_WinInfoText: TAction; Action_Copy_WinInfoWindowSize: TAction; Action_Copy_WinInfoWindowSizeLeft: TAction; Action_Copy_WinInfoWindowSizeTop: TAction; Action_Copy_WinInfoWindowSizeWidth: TAction; Action_Copy_WinInfoWindowSizeHeight: TAction; Action_Copy_WinInfoClientSize: TAction; Action_Copy_WinInfoClientSizeWidth: TAction; Action_Copy_WinInfoClientSizeHeight: TAction; Action_Copy_WinInfoRect: TAction; Action_Copy_WinInfoRectLeft: TAction; Action_Copy_WinInfoRectTop: TAction; Action_Copy_WinInfoRectRight: TAction; Action_Copy_WinInfoRectBottom: TAction; Action_Copy_WinInfoControlID: TAction; Action_Copy_WinInfoStyle: TAction; Action_Copy_WinInfoStyleEx: TAction; Action_Copy_WinInfoStyleVerbose: TAction; Action_Copy_WinInfoPID: TAction; Action_Copy_WinInfoExeName: TAction; Action_Copy_WinInfoFileVersion: TAction; Action_Write_InfoCash: TAction; Action_Write_ClearCash: TAction; Action_Write_TextClear: TAction; Action_Write_ClipboardText: TAction; Action_Write_ColorRGB: TAction; Action_Write_ColorRGBRed: TAction; Action_Write_ColorRGBGreen: TAction; Action_Write_ColorRGBBlue: TAction; Action_Write_ColorHTML: TAction; Action_Write_ColorCOLORREF: TAction; Action_Write_ColorHSV: TAction; Action_Write_ColorHSVHue: TAction; Action_Write_ColorHSVSaturation: TAction; Action_Write_ColorHSVValue: TAction; Action_Write_ColorHLS: TAction; Action_Write_ColorHLSHue: TAction; Action_Write_ColorHLSSaturation: TAction; Action_Write_ColorHLSLightness: TAction; Action_Write_ColorHLSWin: TAction; Action_Write_ColorHLSWinHue: TAction; Action_Write_ColorHLSWinSaturation: TAction; Action_Write_ColorHLSWinLightness: TAction; Action_Write_PosScreen: TAction; Action_Write_PosScreenX: TAction; Action_Write_PosScreenY: TAction; Action_Write_PosMonitor: TAction; Action_Write_PosMonitorX: TAction; Action_Write_PosMonitorY: TAction; Action_Write_PosClient: TAction; Action_Write_PosClientX: TAction; Action_Write_PosClientY: TAction; Action_Write_PosLength: TAction; Action_Write_PosLengthWidth: TAction; Action_Write_PosLengthHeight: TAction; Action_Write_WinInfoWindowSize: TAction; Action_Write_WinInfoWindowSizeLeft: TAction; Action_Write_WinInfoWindowSizeTop: TAction; Action_Write_WinInfoWindowSizeWidth: TAction; Action_Write_WinInfoWindowSizeHeight: TAction; Action_Write_WinInfoClientSize: TAction; Action_Write_WinInfoClientSizeWidth: TAction; Action_Write_WinInfoClientSizeHeight: TAction; Action_Write_WinInfoRect: TAction; Action_Write_WinInfoRectLeft: TAction; Action_Write_WinInfoRectTop: TAction; Action_Write_WinInfoRectRight: TAction; Action_Write_WinInfoRectBottom: TAction; Action_Write_WinInfoControlID: TAction; Action_Write_WinInfoStyle: TAction; Action_Write_WinInfoStyleEx: TAction; Action_Write_WinInfoPID: TAction; Action_Write_WinInfoExeName: TAction; Action_Write_WinInfoFileVersion: TAction; Action_Write_WinInfoHandle: TAction; Action_Write_WinInfoClassName: TAction; Action_Write_WinInfoText: TAction; Action_Capture_Lupe: TAction; Action_Capture_Fixed: TAction; Action_Capture_Pause: TAction; Action_Capture_Update: TAction; Action_Capture_Disp_x1: TAction; Action_Capture_MoveCursorToPoint: TAction; Action_Capture_PointFromCursor: TAction; Action_Capture_NoSelfCapture: TAction; Action_Capture_SmoothCapture: TAction; Action_Test_FlipNone: TAction; Action_Test_FlipHorizontal: TAction; Action_Test_FlipVertical: TAction; Action_Test_Rotate90: TAction; Action_Test_Rotate180: TAction; Action_Test_Rotate270: TAction; Action_Opt_StayOnTop: TAction; Action_Opt_TitleBar: TAction; Action_Opt_ToolBar: TAction; Action_Opt_SelFont: TAction; Action_Opt_LargeIcon: TAction; Action_Opt_ZoomWheel: TAction; Action_Test_APITest: TAction; Action_Test_AeroThemeOnOff: TAction; Action_Custom_Setting: TAction; Action_Custom_Menu: TAction; Action_Custom_ToolBar: TAction; Action_Custom_ShortCut: TAction; Action_Custom_Copy: TAction; Action_Menu_Main: TAction; Action_Menu_Zoom: TAction; Action_Menu_Grid: TAction; Action_Menu_Color: TAction; Action_Menu_Pos: TAction; Action_Menu_WinInfo: TAction; Action_Menu_Copy: TAction; Action_Menu_Capture: TAction; Action_Menu_Setting: TAction; Action_Help: TAction; Action_File_Minimize: TAction; Action_File_Exit: TAction; Action_Move_Monitor: TAction; Action_Move_Left: TAction; Action_Move_Right: TAction; Action_Move_Up: TAction; Action_Move_Down: TAction; ActionList2: TActionList; PopupMenu_Main: TPopupMenu; MenuItem_Zoom: TMenuItem; MenuItem_Zoom_1: TMenuItem; MenuItem_Zoom_2: TMenuItem; MenuItem_Zoom_3: TMenuItem; MenuItem_Zoom_4: TMenuItem; MenuItem_Zoom_6: TMenuItem; MenuItem_Zoom_8: TMenuItem; MenuItem_Zoom_10: TMenuItem; MenuItem_Zoom_12: TMenuItem; MenuItem_Zoom_16: TMenuItem; MenuItem_Zoom_20: TMenuItem; MenuItem_Grid: TMenuItem; MenuItem_Grid_Disp: TMenuItem; MenuItem_Grid_LineGrid: TMenuItem; MenuItem_Grid_Gray: TMenuItem; MenuItem_Grid_Black: TMenuItem; MenuItem_Grid_White: TMenuItem; MenuItem_Grid_Invert: TMenuItem; MenuItem_Grid_Transparent: TMenuItem; MenuItem_Grid_SelColor: TMenuItem; MenuItem_Grid_LineSubGrid: TMenuItem; MenuItem_Grid_SubNone: TMenuItem; MenuItem_Grid_SubBlue: TMenuItem; MenuItem_Grid_SubRed: TMenuItem; MenuItem_Grid_SelSubColor: TMenuItem; MenuItem_Grid_LineSubGrid2: TMenuItem; MenuItem_Grid_UseSubElseColor: TMenuItem; MenuItem_Grid_SelSubElseColor: TMenuItem; MenuItem_Main_Line1: TMenuItem; MenuItem_Color: TMenuItem; MenuItem_Color_HTML: TMenuItem; MenuItem_Color_RGB: TMenuItem; MenuItem_Color_ColorRef: TMenuItem; MenuItem_Color_HSV: TMenuItem; MenuItem_Color_HLS: TMenuItem; MenuItem_Color_HLSWin: TMenuItem; MenuItem_Color_Line1: TMenuItem; MenuItem_Color_InfoOnOff: TMenuItem; MenuItem_Pos: TMenuItem; MenuItem_Pos_Screen: TMenuItem; MenuItem_Pos_Monitor: TMenuItem; MenuItem_Pos_Client: TMenuItem; MenuItem_Pos_Length: TMenuItem; MenuItem_Pos_Line1: TMenuItem; MenuItem_Pos_InfoOnOff: TMenuItem; MenuItem_WinInfo: TMenuItem; MenuItem_WinInfo_Handle: TMenuItem; MenuItem_WinInfo_ClassName: TMenuItem; MenuItem_WinInfo_Text: TMenuItem; MenuItem_WinInfo_WindowSize: TMenuItem; MenuItem_WinInfo_ClientSize: TMenuItem; MenuItem_WinInfo_Rect: TMenuItem; MenuItem_WinInfo_ControlID: TMenuItem; MenuItem_WinInfo_Enabled: TMenuItem; MenuItem_WinInfo_Style: TMenuItem; MenuItem_WinInfo_ParentWindow: TMenuItem; MenuItem_WinInfo_PID: TMenuItem; MenuItem_WinInfo_ExeName: TMenuItem; MenuItem_WinInfo_FileVersion: TMenuItem; MenuItem_WinInfo_Line1: TMenuItem; MenuItem_WinInfo_StyleVerbose: TMenuItem; MenuItem_WinInfo_Line2: TMenuItem; MenuItem_WinInfo_InfoOnOff: TMenuItem; MenuItem_Main_Line2: TMenuItem; MenuItem_Copy: TMenuItem; MenuItem_Copy_Picture: TMenuItem; MenuItem_Copy_Line1: TMenuItem; MenuItem_Copy_ColorRGB: TMenuItem; MenuItem_Copy_ColorRGBRed: TMenuItem; MenuItem_Copy_ColorRGBGreen: TMenuItem; MenuItem_Copy_ColorRGBBlue: TMenuItem; MenuItem_Copy_ColorHTML: TMenuItem; MenuItem_Copy_ColorColorRef: TMenuItem; MenuItem_Copy_ColorHSV: TMenuItem; MenuItem_Copy_ColorHLS: TMenuItem; MenuItem_Copy_ColorHLSWin: TMenuItem; MenuItem_Copy_ColorHSVHue: TMenuItem; MenuItem_Copy_ColorHSVSaturation: TMenuItem; MenuItem_Copy_ColorHSVValue: TMenuItem; MenuItem_Copy_ColorHLSHue: TMenuItem; MenuItem_Copy_ColorHLSSaturation: TMenuItem; MenuItem_Copy_ColorHLSLightness: TMenuItem; MenuItem_Copy_ColorHLSWinHue: TMenuItem; MenuItem_Copy_ColorHLSWinSaturation: TMenuItem; MenuItem_Copy_ColorHLSWinLightness: TMenuItem; MenuItem_Copy_Line2: TMenuItem; MenuItem_Copy_PosScreen: TMenuItem; MenuItem_Copy_PosScreenX: TMenuItem; MenuItem_Copy_PosScreenY: TMenuItem; MenuItem_Copy_PosMonitor: TMenuItem; MenuItem_Copy_PosMonitorX: TMenuItem; MenuItem_Copy_PosMonitorY: TMenuItem; MenuItem_Copy_PosClient: TMenuItem; MenuItem_Copy_PosClientX: TMenuItem; MenuItem_Copy_PosClientY: TMenuItem; MenuItem_Copy_PosUser: TMenuItem; MenuItem_Copy_PosUserWidth: TMenuItem; MenuItem_Copy_PosUserHeight: TMenuItem; MenuItem_Copy_Line3: TMenuItem; MenuItem_Copy_WinInfoHandle: TMenuItem; MenuItem_Copy_WinInfoClassName: TMenuItem; MenuItem_Copy_WinInfoText: TMenuItem; MenuItem_Copy_WinInfoWindowSize: TMenuItem; MenuItem_Copy_WinInfoWindowSizeLeft: TMenuItem; MenuItem_Copy_WinInfoWindowSizeTop: TMenuItem; MenuItem_Copy_WinInfoWindowSizeWidth: TMenuItem; MenuItem_Copy_WinInfoWindowSizeHeight: TMenuItem; MenuItem_Copy_WinInfoClientSize: TMenuItem; MenuItem_Copy_WinInfoClientSizeWidth: TMenuItem; MenuItem_Copy_WinInfoClientSizeHeight: TMenuItem; MenuItem_Copy_WinInfoRect: TMenuItem; MenuItem_Copy_WinInfoRectLeft: TMenuItem; MenuItem_Copy_WinInfoRectTop: TMenuItem; MenuItem_Copy_WinInfoRectRight: TMenuItem; MenuItem_Copy_WinInfoRectBottom: TMenuItem; MenuItem_Copy_WinInfoControlID: TMenuItem; MenuItem_Copy_WinInfoStyle: TMenuItem; MenuItem_Copy_WinInfoStyleEx: TMenuItem; MenuItem_Copy_WinInfoPID: TMenuItem; MenuItem_Copy_WinInfoExeName: TMenuItem; MenuItem_Copy_WinInfoFileVersion: TMenuItem; MenuItem_Copy_Line4: TMenuItem; MenuItem_Copy_All: TMenuItem; MenuItem_Write: TMenuItem; MenuItem_Write_InfoCash: TMenuItem; MenuItem_Write_ClearCash: TMenuItem; MenuItem_Write_Line1: TMenuItem; MenuItem_Write_TextClear: TMenuItem; MenuItem_Write_ClipboardText: TMenuItem; MenuItem_Write_ColorRGB: TMenuItem; MenuItem_Write_ColorRGBRed: TMenuItem; MenuItem_Write_ColorRGBGreen: TMenuItem; MenuItem_Write_ColorRGBBlue: TMenuItem; MenuItem_Write_ColorHTML: TMenuItem; MenuItem_Write_ColorCOLORREF: TMenuItem; MenuItem_Write_ColorHSV: TMenuItem; MenuItem_Write_ColorHLS: TMenuItem; MenuItem_Write_ColorHLSWin: TMenuItem; MenuItem_Write_ColorHSVHue: TMenuItem; MenuItem_Write_ColorHSVSaturation: TMenuItem; MenuItem_Write_ColorHSVValue: TMenuItem; MenuItem_Write_ColorHLSHue: TMenuItem; MenuItem_Write_ColorHLSSaturation: TMenuItem; MenuItem_Write_ColorHLSLightness: TMenuItem; MenuItem_Write_ColorHLSWinHue: TMenuItem; MenuItem_Write_ColorHLSWinSaturation: TMenuItem; MenuItem_Write_ColorHLSWinLightness: TMenuItem; MenuItem_Write_Line2: TMenuItem; MenuItem_Write_PosScreen: TMenuItem; MenuItem_Write_PosMonitor: TMenuItem; MenuItem_Write_PosClient: TMenuItem; MenuItem_Write_PosUser: TMenuItem; MenuItem_Write_PosScreenX: TMenuItem; MenuItem_Write_PosScreenY: TMenuItem; MenuItem_Write_PosMonitorX: TMenuItem; MenuItem_Write_PosMonitorY: TMenuItem; MenuItem_Write_PosClientX: TMenuItem; MenuItem_Write_PosClientY: TMenuItem; MenuItem_Write_PosUserWidth: TMenuItem; MenuItem_Write_PosUserHeight: TMenuItem; MenuItem_Write_Line3: TMenuItem; MenuItem_Write_WinInfoHandle: TMenuItem; MenuItem_Write_WinInfoClassName: TMenuItem; MenuItem_Write_WinInfoText: TMenuItem; MenuItem_Write_WinInfoWindowSize: TMenuItem; MenuItem_Write_WinInfoWindowSizeLeft: TMenuItem; MenuItem_Write_WinInfoWindowSizeTop: TMenuItem; MenuItem_Write_WinInfoWindowSizeWidth: TMenuItem; MenuItem_Write_WinInfoWindowSizeHeight: TMenuItem; MenuItem_Write_WinInfoClientSize: TMenuItem; MenuItem_Write_WinInfoClientSizeWidth: TMenuItem; MenuItem_Write_WinInfoClientSizeHeight: TMenuItem; MenuItem_Write_WinInfoRect: TMenuItem; MenuItem_Write_WinInfoRectLeft: TMenuItem; MenuItem_Write_WinInfoRectTop: TMenuItem; MenuItem_Write_WinInfoRectRight: TMenuItem; MenuItem_Write_WinInfoRectBottom: TMenuItem; MenuItem_Write_WinInfoControlID: TMenuItem; MenuItem_Write_WinInfoStyle: TMenuItem; MenuItem_Write_WinInfoStyleEx: TMenuItem; MenuItem_Write_WinInfoPID: TMenuItem; MenuItem_Write_WinInfoExeName: TMenuItem; MenuItem_Write_WinInfoFileVersion: TMenuItem; MenuItem_Capture: TMenuItem; MenuItem_Capture_Pause: TMenuItem; MenuItem_Capture_Line1: TMenuItem; MenuItem_Capture_Lupe: TMenuItem; MenuItem_Capture_Fixed: TMenuItem; MenuItem_Capture_Line2: TMenuItem; MenuItem_Capture_Update: TMenuItem; MenuItem_Capture_NoSelfCapture: TMenuItem; MenuItem_Capture_SmoothCapture: TMenuItem; MenuItem_Test_Flip: TMenuItem; Menuitem_Test_FlipNone: TMenuItem; MenuItem_Test_FlipHorizontal: TMenuItem; MenuItem_Test_FlipVertical: TMenuItem; MenuItem_Test_Rotate90: TMenuItem; MenuItem_Test_Rotate180: TMenuItem; MenuItem_Test_Rotate270: TMenuItem; MenuItem_Customize: TMenuItem; MenuItem_Opt_TitleBar: TMenuItem; MenuItem_Opt_StayOnTop: TMenuItem; MenuItem_Opt_ToolBar: TMenuItem; MenuItem_Opt_LargeIcon: TMenuItem; MenuItem_Opt_SelFont: TMenuItem; MenuItem_Opt_ZoomWheel: TMenuItem; MenuItem_Opt_Line1: TMenuItem; MenuItem_Test_AeroThemeOnOff: TMenuItem; MenuItem_Test_DispAPITest: TMenuItem; MenuItem_Opt_Line2: TMenuItem; MenuItem_Customize_Setting: TMenuItem; MenuItem_Customize_Menu: TMenuItem; MenuItem_Customize_ToolBar: TMenuItem; MenuItem_Customize_ShortCut: TMenuItem; MenuItem_Customize_Copy: TMenuItem; MenuItem_Main_Line3: TMenuItem; MenuItem_Help: TMenuItem; MenuItem_File_Minimize: TMenuItem; MenuItem_Main_Line4: TMenuItem; MenuItem_File_Exit: TMenuItem; PopupMenu_ToolBar: TPopupMenu; MenuItem_ToolBar_Opt_Customize: TMenuItem; PopupMenu_Zoom: TPopupMenu; PopupMenu_Grid: TPopupMenu; PopupMenu_Color: TPopupMenu; PopupMenu_Pos: TPopupMenu; PopupMenu_WinInfo: TPopupMenu; PopupMenu_Copy: TPopupMenu; PopupMenu_Capture: TPopupMenu; PopupMenu_Setting: TPopupMenu; Panel_ToolBar: TPanel; ToolBar_Main: TToolBar; ToolButton_Grid_Disp: TToolButton; ToolButton_Color_InfoOnOff: TToolButton; ToolButton_Pos_InfoOnOff: TToolButton; ToolButton_WinInfo_InfoOnOff: TToolButton; ToolButton_Custom_Setting: TToolButton; Panel_CaptureMove: TPanel; SpeedButton_Capture_MoveLeft: TSpeedButton; SpeedButton_Capture_MoveUp: TSpeedButton; SpeedButton_Capture_MoveDown: TSpeedButton; SpeedButton_Capture_MoveRight: TSpeedButton; Timer_Main: TTimer; Timer_Infomation: TTimer; Timer_CaptureMove: TTimer; ImageList_Icon: TImageList; ImageList_LargeIcon: TImageList; ImageList_InfoIcon: TImageList; ColorDialog: TColorDialog; ApplicationEvents1: TApplicationEvents; MenuItem_ToolBar_Opt_ToolBar: TMenuItem; MenuItem_ToolBar_Opt_LargeIcon: TMenuItem; MenuItem_ToolBar_Line1: TMenuItem; Action_Test_Rop_BLACKNESS: TAction; Action_Test_Rop_DSTINVERT: TAction; Action_Test_Rop_MERGECOPY: TAction; Action_Test_Rop_MERGEPAINT: TAction; Action_Test_Rop_NOTSRCCOPY: TAction; Action_Test_Rop_NOTSRCERASE: TAction; Action_Test_Rop_SRCAND: TAction; Action_Test_Rop_SRCCOPY: TAction; Action_Test_Rop_SRCERASE: TAction; Action_Test_Rop_SRCINVERT: TAction; Action_Test_Rop_SRCPAINT: TAction; Action_Test_Rop_WHITENESS: TAction; MenuItem_Test_ROP: TMenuItem; MenuItem_Test_Rop_SRCCOPY: TMenuItem; MenuItem_Test_Rop_BLACKNESS: TMenuItem; MenuItem_Test_Rop_DSTINVERT: TMenuItem; MenuItem_Test_Rop_MERGECOPY: TMenuItem; MenuItem_Test_Rop_MERGEPAINT: TMenuItem; MenuItem_Test_Rop_NOTSRCCOPY: TMenuItem; MenuItem_Test_Rop_NOTSRCERASE: TMenuItem; MenuItem_Test_Rop_SRCAND: TMenuItem; MenuItem_Test_Rop_SRCERASE: TMenuItem; MenuItem_Test_Rop_SRCINVERT: TMenuItem; MenuItem_Test_Rop_SRCPAINT: TMenuItem; MenuItem_Test_Rop_WHITENESS: TMenuItem; Action_Test_Brush_Solid: TAction; Action_Test_Brush_Clear: TAction; Action_Test_Brush_Horizontal: TAction; Action_Test_Brush_Vertical: TAction; Action_Test_Brush_FDiagonal: TAction; Action_Test_Brush_BDiagonal: TAction; Action_Test_Brush_Cross: TAction; Action_Test_Brush_DiagCross: TAction; MenuItem_Brush: TMenuItem; MenuItem_Capture_Brush_Solid: TMenuItem; MenuItem_Capture_Brush_Clear: TMenuItem; MenuItem_Capture_Brush_Horizontal: TMenuItem; MenuItem_Capture_Brush_Vertical: TMenuItem; MenuItem_Capture_Brush_FDiagonal: TMenuItem; MenuItem_Capture_Brush_BDiagonal: TMenuItem; MenuItem_Capture_Brush_Cross: TMenuItem; MenuItem_Capture_Brush_DiagCross: TMenuItem; Action_Test_Brush_Bitmap: TAction; MenuItem_Capture_Brush_Bitmap: TMenuItem; Action_Test_Brush_SelColor: TAction; Action_Test_Brush_SelBkColor: TAction; MenuItem_Test: TMenuItem; MenuItem_Test_Line1: TMenuItem; MenuItem_Capture_Brush_SelColor: TMenuItem; MenuItem_Capture_Brush_SelBkColor: TMenuItem; Action_Test_Rop_PATCOPY: TAction; Action_Test_Rop_PATINVERT: TAction; Action_Test_Rop_PATPAINT: TAction; MenuItem_Test_Rop_PATCOPY: TMenuItem; MenuItem_Test_Rop_PATINVERT: TMenuItem; MenuItem_Test_Rop_PATPAINT: TMenuItem; Action_Menu_Test: TAction; PopupMenu_Test: TPopupMenu; MenuItem_Test_Brush_Line1: TMenuItem; actSpc: TAction; Action_Menu_Write: TAction; Action_Move_OptMoveBitmap: TAction; MenuItem_Test_Flip_Line1: TMenuItem; MenuItem_Move_OptMoveBitmap: TMenuItem; FontDialog1: TFontDialog; Action_Opt_LineTo: TAction; MenuItem_Opt_LineTo: TMenuItem; procedure actNop(Sender: TObject); procedure Action_ZoomExecute (Sender: TObject); procedure Action_Zoom_UpExecute (Sender: TObject); procedure Action_Zoom_DownExecute(Sender: TObject); procedure Action_Grid_DispExecute (Sender: TObject); procedure Action_Grid_ColorExecute (Sender: TObject); procedure Action_Grid_SubColorExecute (Sender: TObject); procedure Action_Grid_SelColorExecute (Sender: TObject); procedure Action_Grid_UseSubElseColorExecute(Sender: TObject); procedure Action_Color_InfoOnOffExecute(Sender: TObject); procedure Action_Pos_LengthPosSetExecute(Sender: TObject); procedure Action_Pos_InfoOnOffExecute (Sender: TObject); // procedure Action_WinInfo_StyleExecute (Sender: TObject); procedure Action_WinInfo_StyleVerboseExecute(Sender: TObject); procedure Action_WinInfo_InfoOnOffExecute (Sender: TObject); procedure Action_Copy_PictureExecute(Sender: TObject); procedure Action_Copy_TextExecute (Sender: TObject); procedure Action_Copy_AllExecute (Sender: TObject); // procedure Action_Copy_OptUnicodeExecute(Sender: TObject); procedure Action_Write_InfoCashExecute (Sender: TObject); procedure Action_Write_ColorRGBExecute (Sender: TObject); procedure Action_Write_ClearCashExecute(Sender: TObject); procedure Action_Capture_PauseExecute (Sender: TObject); procedure Action_Capture_UpdateExecute (Sender: TObject); procedure Action_Capture_LupeExecute (Sender: TObject); procedure Action_Capture_FixedExecute (Sender: TObject); procedure Action_Capture_MoveCursorToPointExecute(Sender: TObject); procedure Action_Capture_PointFromCursorExecute (Sender: TObject); procedure Action_Capture_NoSelfCaptureExecute (Sender: TObject); procedure Action_Capture_SmoothCaptureExecute (Sender: TObject); procedure Action_Test_FlipNoneExecute(Sender: TObject); procedure Action_Test_Rop_SRCCOPYExecute(Sender: TObject); procedure Action_Test_Brush_SolidExecute(Sender: TObject); procedure Action_Test_Brush_BitmapExecute(Sender: TObject); procedure Action_Test_Brush_SelColorExecute(Sender: TObject); procedure Action_Opt_StayOnTopExecute (Sender: TObject); procedure Action_Opt_TitleBarExecute (Sender: TObject); procedure Action_Opt_ToolBarExecute (Sender: TObject); procedure Action_Opt_SelFontExecute (Sender: TObject); procedure Action_Test_AeroThemeOnOffExecute(Sender: TObject); procedure Action_Test_APITestExecute (Sender: TObject); procedure Action_Opt_LargeIconExecute(Sender: TObject); procedure Action_Opt_SelBkColorExecute(Sender: TObject); procedure Action_Custom_SettingExecute (Sender: TObject); procedure Action_Custom_MenuExecute (Sender: TObject); procedure Action_Custom_ToolBarExecute (Sender: TObject); procedure Action_Custom_ShortCutExecute(Sender: TObject); procedure Action_Custom_CopyExecute (Sender: TObject); procedure Action_Menu_MainExecute(Sender: TObject); procedure Action_Move_MonitorExecute (Sender: TObject); procedure Action_Move_LeftExecute (Sender: TObject); procedure Action_HelpExecute (Sender: TObject); procedure Action_File_MinimizeExecute(Sender: TObject); procedure Action_File_ExitExecute (Sender: TObject); procedure MenuItem_WriteAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); procedure MenuItem_WriteMeasureItem(Sender: TObject; ACanvas: TCanvas; var Width, Height: Integer); procedure FormCreate (Sender: TObject); procedure FormDestroy (Sender: TObject); procedure FormResize (Sender: TObject); procedure FormPaint (Sender: TObject); procedure FormDblClick (Sender: TObject); procedure FormKeyDown (Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormKeyUp (Sender: TObject; var Key: Word; Shift: TShiftState); procedure FormMouseUp (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormMouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure FormMouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormMouseWheelUp (Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); procedure Panel_ToolBarMouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure ToolButton_Grid_DispMouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure ToolButton_Grid_DispMouseUp (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure SpeedButton_Capture_MoveLeftMouseDown (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure SpeedButton_Capture_MoveLeftMouseUp (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure btnToolCapture_Disp_x1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure btnToolCapture_Disp_x1MouseUp (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure btnToolCapture_Disp_x1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure Timer_MainTimer (Sender: TObject); procedure Timer_InfomationTimer (Sender: TObject); procedure Timer_CaptureMoveTimer (Sender: TObject); procedure ApplicationEvents1Activate (Sender: TObject); procedure ApplicationEvents1Deactivate (Sender: TObject); procedure ApplicationEvents1ShortCut (var Msg: TWMKey; var Handled: Boolean); procedure ApplicationEvents1Message (var Msg: tagMSG; var Handled: Boolean); procedure ApplicationEvents1Exception (Sender: TObject; E: Exception); private { Private 宣言 } FbThrough : Boolean; //無用なイベントを捨てる FbThroughTimer : Boolean; //タイマー処理中に処理し切れなかったイベントを捨てるため FiZoom : Integer; //倍率 FiZoomIndex : Integer; //選択されている倍率メニューのインデックス FiZoomBak : Integer; //一時停止、定点キャプチャ時に一時的に倍率を1倍にするために必要 FclGridColor : TColor; //グリッドの色 FclGridSubColor : TColor; //サブグリッドの色 FclGridSubElseColor : TColor; //サブグリッドの2色目の色 FpmPenMode : TPenMode; //反転色、半透明色があるために必要 FBitmapNoSelf : TBitmap; //自身をキャプチャしないオプションの切り替えのために必要 FBitmapDesktop : TBitmap; //一時停止時にデスクトップをコピー。以前はコピー元のバッファとしても使いまわしていた。 FBitmapDraw : TBitmap; //最終的にこれがSelf.Canvasにコピーされる FBitmapCopy : TBitmap; //反転・回転のために必要になった(とはいえ元々必要ではあった)コピー元のバッファ FBitmapBrush : TMyBitmap; //ファイルを読み込むためTMyBitmap。ブラシにセットしてテストするため FZoomSize : T_ZoomSize; //拡大画像を得るための各種のサイズの詰め合わせ //情報表示部 FrcInfo : TRect; //情報表示領域 FsInfomation : WideString; //1行表示 FiFontHeight : Integer; //文字の高さ=一行の高さ FiInfoLeft : Integer; //ステータスアイコン表示のLeft値 FiVLine : Integer; //情報表示の項目名と情報との境に引くラインの横の位置 FbInfoDrag : Boolean; //項目名と情報の境に引くラインを移動するか FrcInfoDrag : TRect; FiPassTime : DWORD; //前回キャプチャからの経過時間 FrDispInfo : T_DispInfo; //表示用の情報 FWriteInfo : T_DispInfo; //ウィンドウへ書き込み用の情報 FWinList : T_WinList; //一時停止時に表示されているウィンドウすべての情報を保持するリスト FbWMMove : Boolean; FptMove_x1 : TPoint; //実寸表示させて本体を移動させるために必要 FptGesture : TPoint; //マウスジェスチャー //コピー用 FsCopyFmt : array[0..G_ciFMTCOUNT]of String; //グリッドのツールボタン用 FToolButton_Grid : TToolButton; //キャプチャ用 FiCapture_Interval : Integer; FiCapture_SmoothInterval : Integer; FiCapture_RefleshTime : Integer; //一時停止時にキャプチャポジションを移動させる FbDragMove : Boolean; //フォームをつかんでいるか FptDragClientPos : TPoint; //ドラッグした時のマウスのクライアント座標 FptDragPos : TPoint; //高DPI対応の一時停止時にドラッグして画像を移動させるために必要なPoint変数。 FptDragScreenPos : TPoint; //ドラッグした時のマウスのスクリーン座標 //スピードボタンでキャプチャポイントを移動させるため FMoveButton : TSpeedButton; {$IFDEF WRITE_CLIPBOARD_TEXT} //クリップボード監視用 FhNextHandle : HWND; //クリップボード監視 {$ENDIF} //一覧設定 FrIniData : T_BugsEyeData; //初期化用 FiMonitorNum : Integer; //前回カーソルがあったモニタの番号(モニタの範囲外にカーソルポイントが移動しないために) // FOnDisplayChange : TNotifyEvent; {$IFDEF PLUGIN} //プラグイン FPlugIn: T_PlugInInfo; {$ENDIF} {$IFDEF WRITE_CLIPBOARD_TEXT} procedure FSetWriteMenuCaption(AMenuItem: TMenuItem; sAdd: WideString); {$ENDIF} {$IFDEF PLUGIN} procedure FGetPlugin; {$ENDIF} //コピー用のファイル名を取得 // function FGetFileName(sExt: WideString): WideString; // procedure FSetDrawBkColor; function FGetMoveAction(AAction: TAction): TAction; function FGetDrawFont: TFont; procedure FSetToolButtonDown(AAction: TAction); function FGetZoomIndex: Integer; procedure FSetZoomIndex(iIndex: Integer); procedure FZoom_UpDown(Sender: TObject); procedure FSetPoint; function FGetPointShift: Integer; function FGetDispFmt(iIndex : Integer) : String; function FGetCopyFmt(iIndex : Integer) : String; procedure FSetCopyFmt(iIndex : Integer; sFmt : String); function FGetInitCopyFmt(iIndex: Integer): String; function FGetCopyZoomGrid: Boolean; function FGetCopyZoomInfo: Boolean; function FGetInitCopyZoomGrid: Boolean; function FGetInitCopyZoomInfo: Boolean; procedure FCapture_KeyDown; procedure FCapture_KeyUp; procedure FCapture_MovePoint(ptPos: TPoint); procedure FSetCapturePosX(iX: Integer); procedure FSetCapturePosY(iY: Integer); procedure FSetCaptureInterval(iTime: Integer); procedure FSetCaptureSmoothInterval(iTime: Integer); procedure FSetCaptureRefleshTime(iTime: Integer); procedure FSetPanelVisible; procedure FSetInfoDrag; function FGetToolBarHeight: Integer; procedure FPushInfomation(sText: WideString); function FIsActionEnabled(AMenuItem: TMenuItem): Boolean; function FGetColorName(clColor: TColor): String; function FGetWindow(ptPos: TPoint): HWND; function FPutInfo(Sender: TObject; AInfo: T_DispInfo; var iInfoTop: Integer): WideString; procedure FTextOut(ACanvas: TCanvas; iLeft, iTop: Integer; sStr: WideString); function FLoadBin: Boolean; procedure FSaveBin; {$IFDEF WRITE_CLIPBOARD_TEXT} //クリップボード監視 procedure FEntryClipboardViewer; procedure FRemoveClipboardViewer; procedure WMDrawClipboard(var Msg: TWMDrawClipboard); message WM_DRAWCLIPBOARD; procedure WMChangeCBChain(var Msg: TWMChangeCBChain); message WM_CHANGECBCHAIN; {$ENDIF} procedure FCheckAeroThemeEnabled(Sender: TObject); procedure WMDwmCompositiOnChanged(var Msg: TMessage); message WM_DWMCOMPOSITIONCHANGED; procedure WMQueryEndSession(var Msg: TWMQueryEndSession); message WM_QUERYENDSESSION; procedure WMDisplayChange (var Msg: TMessage); message WM_DISPLAYCHANGE; procedure WMSysCommand (var Msg: TWMSysCommand); message WM_SYSCOMMAND; procedure WMMove (var Msg: TWMMove); message WM_MOVE; procedure WMApp (var Msg: TMessage); message WM_APP; {$IFDEF ERASEBKGND} procedure WMEraseBkGnd (var Msg: TMessage); message WM_ERASEBKGND; {$ENDIF} protected // procedure CreateParams(var Params: TCreateParams); override; public { Public 宣言 } function Get_IDMToMenuItem(iIDM: Word): TMenuItem; function Get_MenuItemToIDM(AMenuItem: TMenuItem): Word; function Get_CommandToAction(iCmd: Word): TAction; function Get_ActionToCommand(AAction: TAction): Word; function Get_IDMToCopyIndex(iIDM: Word): Word; function Get_CopyIndexToIDM(iIndex: Word): Word; //------------------------------------------------------------------------------ //準汎用フォーム用 //メニュー procedure SetToolButtonMenu(AToolButton: TToolButton; AAction: TAction); //------------------------------------------------------------------------------ procedure DrawNow; procedure MoveCursorToPoint(Sender: TObject); procedure AddList(AList: TStrings; sStr: WideString); // property OnDisplayChange: TNotifyEvent read FOnDisplayChange write FOnDisplayChange; property DrawFont: TFont read FGetDrawFont; //一覧設定 property InitData: T_BugsEyeData read FrIniData; //コピーフォーマット property CopyFmt [iIndex: Integer]: String read FGetCopyFmt write FSetCopyFmt; property InitCopyFmt[iIndex: Integer]: String read FGetInitCopyFmt; property CopyZoomGrid : Boolean read FGetCopyZoomGrid; property CopyZoomInfo : Boolean read FGetCopyZoomInfo; property InitCopyZoomGrid : Boolean read FGetInitCopyZoomGrid; property InitCopyZoomInfo : Boolean read FGetInitCopyZoomInfo; property ZoomIndex : Integer read FGetZoomIndex write FSetZoomIndex; property LengthPos : TPoint read FrDispInfo.ptLengthPos; property LengthPosX : Integer read FrDispInfo.ptLengthPos.X write FrDispInfo.ptLengthPos.X; property LengthPosY : Integer read FrDispInfo.ptLengthPos.Y write FrDispInfo.ptLengthPos.Y; property FixedPosX : Integer read FrDispInfo.ptMousePos.X write FSetCapturePosX; property FixedPosY : Integer read FrDispInfo.ptMousePos.Y write FSetCapturePosY; // property CaptureInterval: Integer read F_iCapture_Interval write F_SetCaptureInterval; // property CaptureSmoothInterval: Integer read F_iCapture_SmoothInterval write F_SetCaptureSmoothInterval; // property CaptureRefleshTime: Integer read F_iCapture_RefleshTime write F_SetCaptureRefleshTime; end; var //------------------------------------------------------------------------------ //準汎用フォーム用 G_MainForm: TApp_BugsEye; G_ActionList: TActionList; G_MenuBar: TMenu; G_ImageList: TImageList; //------------------------------------------------------------------------------ App_BugsEye: TApp_BugsEye; G_APITestCallWindow: TApp_BugsEye; implementation uses {$IFDEF _DEBUG} myDebug, {$ENDIF} Clipbrd, CommCtrl, GraphUtil, my_monitor, common, {$IFNDEF PLUGIN} windowstyle, {$ENDIF} sub_api, my_settingfile, custom_base, custom_setting, custom_menu, custom_toolbar, custom_shortcut, custom_copy, custom_help; {$R *.dfm} //============================================================================== {$IFDEF PLUGIN} constructor T_PluginInfo.Create; begin inherited; FsFileName := ''; FhWindowHandle := 0; end; procedure T_PluginInfo.FSetFileName(sFile: WideString); begin FsFileName := sFile; end; {$ENDIF} //============================================================================== procedure TApp_BugsEye.SetToolButtonMenu(AToolButton: TToolButton; AAction: TAction); var l_PopupMenu, l_DropdownMenu: TPopupMenu; begin l_PopupMenu := nil; l_DropdownMenu := nil; { if (AAction.GroupIndex > 0) then begin AToolButton.OnMouseUp := ToolButton_Grid_DispMouseUp; end; } //この二つはAutoCheckがFalseなのでここでチェックボタンにする if (AAction = Action_Capture_Pause) or (AAction = Action_Capture_Fixed) then begin AToolButton.Style := tbsCheck; end; if (AAction.Category = Action_Zoom_1.Category) then begin //ズーム l_PopupMenu := PopupMenu_Zoom; end else if (AAction.Category = Action_Grid_Disp.Category) then begin //グリッド l_PopupMenu := PopupMenu_Grid; if (AAction = Action_Grid_Disp) then begin // AToolButton.Style := tbsCheck; { AToolButton.Style := tbsDropDown; AToolButton.OnMouseDown := ToolButton_Grid_DispMouseDown; AToolButton.OnMouseUp := ToolButton_Grid_DispMouseUp; l_DropdownMenu := l_PopupMenu; } end; end else if (AAction.Category = Action_Color_RGB.Category) then begin //カラー l_PopupMenu := PopupMenu_Color; end else if (AAction.Category = Action_Pos_Screen.Category) then begin //カーソル位置 l_PopupMenu := PopupMenu_Pos; end else if (AAction.Category = Action_WinInfo_Handle.Category) then begin //ウィンドウ情報 l_PopupMenu := PopupMenu_WinInfo; end else if (AAction.Category = Action_Copy_Picture.Category) then begin //コピー l_PopupMenu := PopupMenu_Copy; end else if (AAction.Category = Action_Capture_Pause.Category) then begin //キャプチャ l_PopupMenu := PopupMenu_Capture; if (AAction = Action_Capture_Disp_x1) then begin //実寸表示 AToolButton.OnMouseDown := btnToolCapture_Disp_x1MouseDown; AToolButton.OnMouseMove := btnToolCapture_Disp_x1MouseMove; AToolButton.OnMouseUp := btnToolCapture_Disp_x1MouseUp; end; end else if (AAction.Category = Action_Opt_StayOnTop.Category) then begin //オプション l_PopupMenu := PopupMenu_Setting; end else if (AAction.Category = Action_Custom_Setting.Category) then begin //カスタマイズ l_PopupMenu := PopupMenu_Setting; end else if (AAction.Category = Action_Menu_Main.Category) then begin //メニュー if (AAction = Action_Menu_Main) then begin //メニュー表示 l_PopupMenu := PopupMenu_Main; end else if (AAction = Action_Menu_Zoom) then begin //ズームメニュー l_PopupMenu := PopupMenu_Zoom; end else if (AAction = Action_Menu_Grid) then begin //グリッドメニュー l_PopupMenu := PopupMenu_Grid; end else if (AAction = Action_Menu_Color) then begin //カラー情報メニュー l_PopupMenu := PopupMenu_Color; end else if (AAction = Action_Menu_Pos) then begin //カーソル位置メニュー l_PopupMenu := PopupMenu_Pos; end else if (AAction = Action_Menu_WinInfo) then begin //ウィンドウ情報メニュー l_PopupMenu := PopupMenu_WinInfo; end else if (AAction = Action_Menu_Copy) then begin //コピーメニュー l_PopupMenu := PopupMenu_Copy; end else if (AAction = Action_Menu_Setting) then begin //設定メニュー l_PopupMenu := PopupMenu_Setting; end else if (AAction = Action_Menu_Capture) then begin //キャプチャメニュー l_PopupMenu := PopupMenu_Capture; end else if (AAction = Action_Menu_Test) then begin //テストメニュー l_PopupMenu := PopupMenu_Test; end else begin l_PopupMenu := nil; end; l_DropdownMenu := l_PopupMenu; end else if {(AAction = nil) or} (AAction = actSpc) then begin //区切り AToolButton.Style := tbsSeparator; AToolButton.Width := 8; end; AToolButton.PopupMenu := l_PopupMenu; AToolButton.DropdownMenu := l_DropdownMenu; end; //============================================================================== {$IFDEF WRITE_CLIPBOARD_TEXT} //------------------------------------------------------------------------------ //クリップボード監視ルーチン procedure TApp_BugsEye.FEntryClipboardViewer; begin FhNextHandle := SetClipboardViewer(Self.Handle); if (FhNextHandle = 0) and (GetLastError <> 0) then begin {エラーだったら} //クリップボードの更新チェックの登録処理に失敗した場合の処理 //ShowMessage('クリップボードの更新チェックの登録処理に失敗しました'); end; end; procedure TApp_BugsEye.FRemoveClipboardViewer; begin //クリップボード監視処理の破棄 ChangeClipboardChain(Self.Handle, FhNextHandle); end; procedure TApp_BugsEye.WMDrawClipboard(var Msg: TWMDrawClipboard); //クリップボード更新フック //更新された後に流れてくる。 //アプリが立ち上がった瞬間も流れる var ls_Text : WideString; begin inherited; if (FhNextHandle <> 0) then begin //次の監視ウィンドウへメッセージ送信 SendMessage(FhNextHandle, WM_DRAWCLIPBOARD, 0, 0); end; ls_Text := gfnsStrFromClipboard; Action_Write_ClipboardText.Enabled := (ls_Text <> ''); if (Action_Write_ClipboardText.Enabled) then begin FSetWriteMenuCaption(MenuItem_Write_ClipboardText, ls_Text); end else begin MenuItem_Write_ClipboardText.Caption := Action_Write_ClipboardText.Caption; end; end; procedure TApp_BugsEye.WMChangeCBChain(var Msg: TWMChangeCBChain); begin if (Msg.Remove = FhNextHandle) then begin //クリップボードをフックしている次のウィンドウがフックを解除した FhNextHandle := Msg.Next; end; if (FhNextHandle <> 0) then begin //次のビューアへメッセージ送信 SendMessage(FhNextHandle, WM_CHANGECBCHAIN, Msg.Remove, Msg.Next); end; end; //------------------------------------------------------------------------------ {$ENDIF} const // FciMINGRID = 4; //グリッドを引く最低倍率 FciMINGRID = 3; //グリッドを引く最低倍率 FciMINSIZE = 50; //描画領域の最小の高さ&フォームの幅 const //タスクバーのメニュー拡張 lciMENU_LINE = 100; lciMENU_OPTCUSTOMIZE = 200; lciMENU_MOVEMONITOR = 201; {$IFDEF ERASEBKGND} procedure TApp_BugsEye.WMEraseBkGnd(var Msg: TMessage); begin //http://hpcgi1.nifty.com/MADIA/DelphiBBS/wwwlng.cgi?print+200504/05040066.txt Msg.Result:=1; end; {$ENDIF} procedure TApp_BugsEye.WMDisplayChange(var Msg: TMessage); //ディスプレイ設定が変わった //var // i : Integer; // l_Form : TForm; begin if not(Action_Capture_Pause.Checked) then begin //一時停止中は一時停止の時点のモニター情報を使うためスキップ MyScreenSize.Reflesh; end; //TScreenがディスプレイの変更に追従しないことへの対策。 Self.Monitor; { //モニター内に納まるようなSetBouds for i := 0 to Screen.FormCount -1 do begin l_Form := Screen.Forms[i]; if (l_Form = App_BugsEye) or (l_Form = App_BugsEyeWindowStyle) or (l_Form = App_CustomBaseForm) then begin MyScreenSize.SetBounds(l_Form); end; end; } end; procedure TApp_BugsEye.Action_Test_AeroThemeOnOffExecute(Sender: TObject); var lb_Aero : Boolean; begin lb_Aero := gfnbIsAeroThemeEnabled; if not(gfnbAeroThemeEnableSet(not(lb_Aero))) then begin if (lb_Aero = gfnbIsAeroThemeEnabled) then begin Beep; end; end; end; procedure TApp_BugsEye.WMDwmCompositiOnChanged(var Msg: TMessage); begin FCheckAeroThemeEnabled(nil); end; procedure TApp_BugsEye.FCheckAeroThemeEnabled(Sender: TObject); var ls_Msg : String; lb_Lupe : Boolean; lb_NoSelf : Boolean; begin if (gfnbIsAeroThemeEnabled) then begin if (Action_Capture_Pause.Checked and Assigned(FWinList) and not(FWinList.AeorThemeEnabled)) then begin //一時停止中にエアロテーマが無効の場合は現在エアロテーマが有効であってもメッセージは出さない Exit; end; lb_Lupe := False; lb_NoSelf := False; if (Sender = nil) or (Sender = Action_Capture_Lupe) then begin lb_Lupe := Action_Capture_Lupe.Checked; end; if (lb_Lupe) then begin Action_Capture_Lupe.Checked := False; ls_Msg := Format(' ・%s', [StripHotKey(Action_Capture_Lupe.Caption)]); end; if (Sender = nil) or (Sender = Action_Capture_NoSelfCapture) then begin lb_NoSelf := Action_Capture_NoSelfCapture.Checked; end; if (lb_NoSelf) then begin Action_Capture_NoSelfCapture.Checked := False; if (ls_Msg <> '') then begin ls_Msg := Format('%s'#13, [ls_Msg]); end; ls_Msg := Format('%s ・%s', [ls_Msg, StripHotKey(Action_Capture_NoSelfCapture.Caption)]); end; if (lb_Lupe) or (lb_NoSelf) then begin gpcShowMessage(Format('Aero テーマが有効の場合以下の機能は使用できません'#13#13'%s'#13#13'機能を解除します', [ls_Msg])); end; end; end; { procedure TApp_BugsEye.CreateParams(var Params: TCreateParams); //タイトルバー無しでもサイズ変更できるようにする begin inherited CreateParams(Params); Params.Style := Params.Style or WS_THICKFRAME; end; } procedure TApp_BugsEye.WMQueryEndSession(var Msg: TWMQueryEndSession); //OS終了メッセージ begin //http://www.wwlnk.com/boheme/delphi/tips/tec0690.htm // Close; FormDestroy(Self); Msg.Result := 1; end; procedure TApp_BugsEye.ApplicationEvents1Exception(Sender: TObject; E: Exception); begin if (Action_Opt_StayOnTop.Checked) then begin //常に前面に表示を解除 Action_Opt_StayOnTop.Checked := False; Action_Opt_StayOnTopExecute(nil); end; gpcShowMessage(E.Message); end; {$IFDEF PLUGIN} procedure TApp_BugsEye.FGetPlugin; { プラグインを読み込んでプラグインメニューに追加する。 プラグインはpluginディレクトリ以下にサブディレクトリを作って置くこと。 +bugseye | +plugin+ | | | +api+ | | | | | +trackbar | | | +style | } const lcs_PLUGIN_DIR = WideString('plugin\'); lcs_CURRENT = WideString('.'); lcs_PARENT = WideString('..'); function _IsPlugin(sFileName: WideString): Boolean; var lh_File : THandle; l_Info : TWin32FindDataW; l_Ext: WideString; // l_PlugIn : T_PlugInInfo; begin Result := False; lh_File := FindFirstFileW(PWideChar(sFileName + '\*.*'), l_Info); try if (lh_File <> INVALID_HANDLE_VALUE) then begin repeat if not(BOOL(l_Info.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY)) then begin l_Ext := WideLowerCase(gfnsFileExtGet(l_Info.cFileName)); Result := (l_Ext = WideString('.exe')) or (l_Ext = WideString('.dll')) ; if (Result) then begin if (l_Ext = WideString('.exe')) then begin FPlugIn := T_PlugInInfo.Create; FPlugIn.PlugInFile := sFileName + '\' + l_Info.cFileName; FPlugIn.Handle := gfnhExecute(FPlugIn.PlugInFile); end; Break; end; end; Application.ProcessMessages; until not(FindNextFileW(lh_File, l_Info)); end; finally Windows.FindClose(lh_File); end; end; var lh_File : THandle; ls_Path : WideString; ls_Plugin : WideString; l_Info : TWin32FindDataW; l_MenuItem: TMenuItem; begin ls_Path := gfnsFilePathGet(gfnsExeNameGet) + lcs_PLUGIN_DIR; ls_Plugin := ls_Path + '*.*'; lh_File := FindFirstFileW(PWideChar(ls_Plugin), l_Info); try if (lh_File <> INVALID_HANDLE_VALUE) then begin repeat if (BOOL(l_Info.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY)) then begin //サブディレクトリだったとき。 //プラグインはpluginディレクトリにサブディレクトリを作って置く。 if (l_Info.cFileName <> lcs_CURRENT) and (l_Info.cFileName <> lcs_PARENT) and (_IsPlugin(ls_Path + l_Info.cFileName)) then begin l_MenuItem := TMenuItem.Create(Self); l_MenuItem.OnAdvancedDrawItem := MenuItem_WriteAdvancedDrawItem; l_MenuItem.OnMeasureItem := MenuItem_WriteMeasureItem; l_MenuItem.Caption := gfnsWideToAnsiEx(l_Info.cFileName); MenuItem_Opt_Plugin.Add(l_MenuItem); end; end; Application.ProcessMessages; until not(FindNextFileW(lh_File, l_Info)); end; finally Windows.FindClose(lh_File); end; end; {$ENDIF} procedure TApp_BugsEye.FormCreate(Sender: TObject); procedure _ToolMenuSet(AParentItem: TMenuItem; AMenuItem: TMenuItem); var i : Integer; l_AddItem : TMenuItem; l_MenuItem : TMenuItem; begin for i := 0 to AMenuItem.Count -1 do begin l_MenuItem := AMenuItem.Items[i]; l_AddItem := TMenuItem.Create(Self); // l_AddItem.Name := l_MenuItem.Name + '_Tool'; l_AddItem.Name := gfnsAvailableName(l_MenuItem.Name + '_Tool'); l_AddItem.Caption := l_MenuItem.Caption; if (l_MenuItem.Caption <> '-') then begin l_AddItem.Action := l_MenuItem.Action; l_AddItem.GroupIndex := l_MenuItem.GroupIndex; l_AddItem.RadioItem := l_MenuItem.RadioItem; // l_AddItem.OnAdvancedDrawItem := MenuItem_WriteAdvancedDrawItem; // l_AddItem.OnMeasureItem := MenuItem_WriteMeasureItem; end; l_AddItem.Visible := l_MenuItem.Visible; AParentItem.Add(l_AddItem); if (l_MenuItem.Count > 0) then begin _ToolMenuSet(l_AddItem, l_MenuItem); end; end; end; var lh_Menu : HMENU; l_Rect : TRect; begin {$IFDEF _DEBUG} // myDebug.gpcMessageModeSet(True); {$ENDIF} //------------------------------------------------------------------------------ //準汎用フォーム用 G_MainForm := Self; G_ActionList := ActionList_Main; G_ToolBar := ToolBar_Main; G_sHelpURL := 'http://drang.s4.xrea.com/program/bugseye/help/'; G_APITestCallWindow := Self; G_pcCreateInitMenuVisible(PopupMenu_Main); G_pcSetInitToolBar(ToolBar_Main); G_pcSetInitShortCut(ActionList_Main); G_pcSetInitMouseGesture( Action_Opt_StayOnTop, //上 Action_Custom_Setting, //下 Action_Grid_Disp, //左 Action_Capture_Pause //右 ); //------------------------------------------------------------------------------ //初期化 FptMove_x1 := Point(-3200, -3200); l_Rect := gfnrcMonitorRectGet(gfnptMousePosGet); SetBounds(l_Rect.Left + 75, l_Rect.Top + 75, Width, Height); //設定の初期化用 with FrIniData do begin iZoomIndex := MenuItem_Zoom.Tag;//ズームメニューのインデックス bGridDisp := Action_Grid_Disp.Checked; iGridIndex := MenuItem_Grid_Gray.MenuIndex; iSubGridIndex := MenuItem_Grid_SubBlue.MenuIndex; clGridColor := Action_Grid_SelColor.Tag; //グリッドの色 clGridSubColor := Action_Grid_SelSubColor.Tag; //サブグリッドの色 clGridSubElseColor := Action_Grid_SelSubElseColor.Tag; //サブグリッド2色目 bGridUseSubElseColor := Action_Grid_UseSubElseColor.Checked; bPos_Screen := Action_Pos_Screen.Checked; bPos_Monitor := Action_Pos_Monitor.Checked; bPos_Client := Action_Pos_Client.Checked; bPos_Length := Action_Pos_Length.Checked; bColor_RGB := Action_Color_RGB.Checked; bColor_HTML := Action_Color_HTML.Checked; bColor_COLORREF := Action_Color_COLORREF.Checked; bColor_HSV := Action_Color_HSV.Checked; bColor_HLS := Action_Color_HLS.Checked; bColor_HLSWin := Action_Color_HLSWin.Checked; bWinInfo_Handle := Action_WinInfo_Handle.Checked; bWinInfo_ClassName := Action_WinInfo_ClassName.Checked; bWinInfo_Text := Action_WinInfo_Text.Checked; bWinInfo_WindowSize := Action_WinInfo_WindowSize.Checked; bWinInfo_ClientSize := Action_WinInfo_ClientSize.Checked; bWinInfo_Rect := Action_WinInfo_Rect.Checked; bWinInfo_ControlID := Action_WinInfo_ControlID.Checked; bWinInfo_Style := Action_WinInfo_Style.Checked; bWinInfo_ParentWindow := Action_WinInfo_ParentWindow.Checked; bWinInfo_PID := Action_WinInfo_PID.Checked; bWinInfo_ExeName := Action_WinInfo_ExeName.Checked; bWinInfo_FileVersion := Action_WinInfo_FileVersion.Checked; bWinInfo_StyleVerbose := Action_WinInfo_StyleVerbose.Checked; bOpt_StayOnTop := Action_Opt_StayOnTop.Checked; bOpt_TitleBar := Action_Opt_TitleBar.Checked; bOpt_ToolBar := Action_Opt_ToolBar.Checked; // bOpt_BigFont := Action_Opt_BigFont.Checked; bOpt_ZoomWheel := Action_Opt_ZoomWheel.Checked; // clOpt_BkColor := clBlack; bOpt_NoSelfCapture := Action_Capture_NoSelfCapture.Checked; bOpt_SmoothCapture := Action_Capture_SmoothCapture.Checked; bCapture_Pause := Action_Capture_Pause.Checked; bCapture_Lupe := Action_Capture_Lupe.Checked; bCapture_Fixed := Action_Capture_Fixed.Checked; iCapture_Interval := Timer_Main.Interval; iCapture_SmoothInterval := Action_Capture_SmoothCapture.Tag; iCapture_RefleshTime := Timer_Main.Tag; end; FillChar(FWriteInfo, SizeOf(FWriteInfo), 0); FbThrough := False; FbDragMove := False; FptGesture := Point(-1, -1); FiMonitorNum := 0; FiZoomIndex := FrIniData.iZoomIndex; FiZoom := MenuItem_Zoom.Items[FiZoomIndex].Action.Tag; FiZoomBak := -1; FclGridColor := MenuItem_Grid.Items[FrIniData.iGridIndex].Action.Tag; FpmPenMode := pmCopy; FclGridSubColor := MenuItem_Grid.Items[FrIniData.iSubGridIndex].Action.Tag; gpcMenuStripHotKey(PopupMenu_ToolBar.Items); //キャプチャ FSetCaptureInterval (Timer_Main.Interval); // FSetCaptureSmoothInterval(actOpt_SmoothCapture.Tag); //Windows 7で終われなくなる FSetCaptureSmoothInterval(Timer_Main.Interval); FSetCaptureRefleshTime (Timer_Main.Tag); FMoveButton := nil; //最大化メニューを削除。 lh_Menu := GetSystemMenu(Self.Handle, False); DeleteMenu (lh_Menu, SC_MAXIMIZE, MF_BYCOMMAND); DrawMenuBar(lh_Menu); //タスクバーのメニュー。モニター間移動を挿入 lh_Menu := GetSystemMenu(Application.Handle, False); InsertMenu(lh_Menu, 0, MF_BYPOSITION or MF_SEPARATOR, 0, nil); InsertMenu(lh_Menu, 0, MF_BYPOSITION, lciMENU_MOVEMONITOR, PChar(Action_Move_Monitor.Caption)); InsertMenu(lh_Menu, 0, MF_BYPOSITION, lciMENU_OPTCUSTOMIZE, PChar(Action_Custom_Setting.Caption)); DrawMenuBar(lh_Menu); FBitmapDraw := TBitmap.Create; FBitmapDraw.Canvas.Font.Assign(Self.Font); FBitmapNoSelf := TBitmap.Create; FBitmapDesktop := TBitmap.Create; FBitmapCopy := TBitmap.Create; FBitmapBrush := TMyBitmap.Create; //情報表示領域の初期設定 with FrcInfo do begin Left := 0; Right := ClientWidth; Top := ClientHeight; Bottom := ClientHeight; end; //コピー用 // FcdCharCode := cdShift_JIS; // Action_Copy_OptUnicodeExecute(nil); // actCustom_Setting.Enabled := False; // gpcCreateSettingForm; // actCustom_Setting.Enabled := True; Action_Test_AeroThemeOnOff.Visible := gfnbIsAeroThemeReady; FrDispInfo.iCapture_Rop := SRCCOPY; FiVLine := (FBitmapDraw.Canvas.TextWidth('A') * G_ciMAXDISPITEM) + (FBitmapDraw.Canvas.TextWidth('A') div 2); if not(FLoadBin) then begin; G_pcShortCutInit; Action_Grid_UseSubElseColorExecute(nil); //サブグリッドカラーの二色目を一色目と同じにするための処理 end; Action_Opt_SelFontExecute(nil); {$IFDEF PLUGIN} FPlugIn := nil; FGetPlugin; {$ENDIF} //ポップアップメニュー作成 _ToolMenuSet(PopupMenu_Zoom.Items, MenuItem_Zoom); _ToolMenuSet(PopupMenu_Grid.Items, MenuItem_Grid); _ToolMenuSet(PopupMenu_Color.Items, MenuItem_Color); _ToolMenuSet(PopupMenu_Pos.Items, MenuItem_Pos); _ToolMenuSet(PopupMenu_WinInfo.Items, MenuItem_WinInfo); _ToolMenuSet(PopupMenu_Copy.Items, MenuItem_Copy); _ToolMenuSet(PopupMenu_Capture.Items, MenuItem_Capture); _ToolMenuSet(PopupMenu_Setting.Items, MenuItem_Customize); _ToolMenuSet(PopupMenu_Test.Items, MenuItem_Test); Tag := 1; //高DPI対応 // SetProcessDPIAware; // Panel_Tool_Base.Height := 25; Action_Opt_LargeIconExecute(nil); Panel_CaptureMove.Left := Self.ClientWidth - Panel_CaptureMove.Width; FormResize(nil); Timer_Main.Enabled := True; {$IFDEF WRITE_CLIPBOARD_TEXT} //クリップボード監視 FEntryClipboardViewer; {$ENDIF} Show; //これがないとプライマリモニターの外に表示されてしまうことがある、不可解。 if not(Action_Opt_StayOnTop.Checked) then begin SetWindowPos(Application.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_SHOWWINDOW); SetWindowPos(Application.Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE); end; // SetForegroundWindow(Self.Handle); Action_Capture_NoSelfCaptureExecute(nil); Action_Capture_SmoothCaptureExecute(nil); Action_Test_APITestExecute(nil); end; //破棄 procedure TApp_BugsEye.FormDestroy(Sender: TObject); begin if (Self.Tag = 0) then begin Exit; end; Self.Tag := 0; Timer_Main.Enabled := False; if (IsZoomed(Handle)) or (IsIconic(Handle)) then begin ShowWindow(Handle, SW_NORMAL); end; Hide; {$IFDEF WRITE_CLIPBOARD_TEXT} //クリップボード監視を解除 FRemoveClipboardViewer; {$ENDIF} FSaveBin; // FCopyCaptionList.Free; // FWriteCaptionList.Free; //↓はこの位置でないとエラーになる FBitmapDesktop.Free; FBitmapNoSelf.Free; FBitmapDraw.Free; FBitmapCopy.Free; FBitmapBrush.Free; FWinList.Free; {$IFDEF PLUGIN} FPlugIn.Free; {$ENDIF} G_APITestDiffList.Free; end; procedure TApp_BugsEye.FormPaint(Sender: TObject); //フォームへ描画 begin //拡大画像の描画。これがメイン。 BitBlt(Canvas.Handle, 0, FGetToolBarHeight, ClientWidth, ClientHeight - FGetToolBarHeight, FBitmapDraw.Canvas.Handle, 0, 0, SRCCOPY); end; procedure TApp_BugsEye.FSetInfoDrag; const lci_DRAG_MARGIN = 2; begin FrcInfoDrag := Rect( FiVLine -lci_DRAG_MARGIN, FrcInfo.Top + FGetToolBarHeight + FiFontHeight, FiVLine +lci_DRAG_MARGIN, FrcInfo.Bottom + FGetToolBarHeight ); //myDebug.gpcDebug(FrcInfoDrag); end; procedure TApp_BugsEye.FormResize(Sender: TObject); //描画領域の変更 function _GetMagniSize(const ASize: T_Size; const fMagni: Extended): T_Size; //ズーム領域調整関数 begin Result.Width := gfniRoundUp(fMagni * ASize.Width); Result.Height := gfniRoundUp(fMagni * ASize.Height); end; { function _GetMagniRect(const rcRect: TRect; const fMagni: Extended): TRect; //ズーム領域調整関数 begin Result := Rect(0, 0, gfniRoundUp(fMagni * gfniRectWidth(rcRect)), gfniRoundUp(fMagni * gfniRectHeight(rcRect))); end; } //============================================================================ var i : Integer; li_ShiftColorPos : Integer; li_ShiftLine : Integer; li_10Line : Integer; li_Width : Integer; li_Height : Integer; li_Max : Integer; l_DispSize : T_Size; // lrc_Screen : TRect; // lrc_Zoom : TRect; begin if (Application.Terminated) then begin Exit; end; if (Self.Tag = 0) then begin Exit; end else begin Self.Tag := 0; end; //情報表示枠の高さをセット------------------------------------------------------ li_Height := 0; FPutInfo(Sender, FrDispInfo, li_Height); ClientHeight := ClientHeight + (li_Height - gfniRectHeight(FrcInfo)); if ((ClientHeight - li_Height) < FciMINSIZE) then begin ClientHeight := FciMINSIZE + li_Height; end; if (ClientWidth < FciMINSIZE) then begin ClientWidth := FciMINSIZE; end; with FrcInfo do begin Right := ClientWidth; Bottom := ClientHeight - FGetToolBarHeight; // Bottom := ClientHeight; Top := Bottom - li_Height; end; Panel_CaptureMove.Top := FrcInfo.Top + FGetToolBarHeight +1; FSetInfoDrag; //拡大のための領域のセット------------------------------------------------------ //ルーラー幅のセット if (Action_Grid_Disp.Checked) then begin FZoomSize.RulerSize.Width := 7; FZoomSize.RulerSize.Height := 7; end else begin FZoomSize.RulerSize.Width := 0; FZoomSize.RulerSize.Height := 0; end; //情報欄、ルーラー、拡大画像も含めた、フォームへの描画用のビットマップ FBitmapDraw.Width := Self.ClientWidth; FBitmapDraw.Height := Self.ClientHeight - FGetToolBarHeight; //拡大画像の描画領域 l_DispSize.Width := ClientWidth - FZoomSize.RulerSize.Width; l_DispSize.Height := FrcInfo.Top - FZoomSize.RulerSize.Height; //グリッドの数 FZoomSize.HorizontalGrid := gfniRound(l_DispSize.Height / FiZoom); //横線 FZoomSize.VerticalGrid := gfniRound(l_DispSize.Width / FiZoom); //縦線 //拡大元のサイズ := ズーム表示領域 / 倍率 FZoomSize.CopySize.Size := _GetMagniSize(l_DispSize, 1/FiZoom); FZoomSize.CopySize.Center.X := gfniRound(FZoomSize.CopySize.Size.Width / 2) -1; //長さではなく座標なので-1 FZoomSize.CopySize.Center.Y := gfniRound(FZoomSize.CopySize.Size.Height / 2) -1; //長さではなく座標なので-1 //回転・反転描画があるので拡大元のサイズを正方形にしたもの li_Max := gfniMax([FZoomSize.CopySize.Size.Width, FZoomSize.CopySize.Size.Height]); if not(Odd(li_Max)) then begin //回転しても中心がずれないように奇数にする Inc(li_Max); end; FZoomSize.SquareSize.Size.Width := li_Max; FZoomSize.SquareSize.Size.Height := li_Max; FZoomSize.SquareSize.Center.X := gfniRound(li_Max / 2) -1; //長さではなく座標なので-1 FZoomSize.SquareSize.Center.Y := gfniRound(li_Max / 2) -1; //長さではなく座標なので-1 FZoomSize.SquareSize.Origin.X := FZoomSize.SquareSize.Center.X - FZoomSize.CopySize.Center.X; FZoomSize.SquareSize.Origin.Y := FZoomSize.SquareSize.Center.Y - FZoomSize.CopySize.Center.Y; FBitmapCopy.Width := FZoomSize.SquareSize.Size.Width; FBitmapCopy.Height := FZoomSize.SquareSize.Size.Height; FZoomSize.ZoomSize := _GetMagniSize(FZoomSize.SquareSize.Size, FiZoom); //グリッドを引くか引かないかでカラーの値を取る位置が1ドットずれる if (FGetPointShift > 1) then begin li_ShiftColorPos := 1; //グリッドあり、1ドット右下にずらす end else begin li_ShiftColorPos := 0; //グリッドなし、そのまま end; //カラー取得位置 FrDispInfo.ptColorPos := Point( FZoomSize.RulerSize.Width + FZoomSize.CopySize.Center.X * FiZoom + li_ShiftColorPos, //X FZoomSize.RulerSize.Height + FZoomSize.CopySize.Center.Y * FiZoom + li_ShiftColorPos //Y ); //ルーラー描画------------------------------------------------------------------ if (Action_Grid_Disp.Checked) then begin with FBitmapDraw.Canvas do begin //PenとBrushをセット Pen.Mode := pmCopy; Brush.Color := clWhite; // FillRect(Rect(0, 0, ClientWidth, FrcInfo.Top)); //↓のようなことをするよりは無効リージョンを設定したほうが多分良い。 FillRect(Rect(0, 0, ClientWidth, FZoomSize.RulerSize.Height)); //ルーラーの上の部分 FillRect(Rect(0, 0, FZoomSize.RulerSize.Width, FrcInfo.Top)); //ルーラーの横の部分 //横の目盛(線は縦に引く) li_ShiftLine := FZoomSize.CopySize.Center.X mod 5; li_10Line := FZoomSize.CopySize.Center.X mod 10; for i := 0 to FZoomSize.VerticalGrid do begin li_Width := i * FiZoom + FZoomSize.RulerSize.Width; if (i = 0) then begin Pen.Color := clSilver; MoveTo(li_Width, 0); LineTo(li_Width, FZoomSize.RulerSize.Height); end else if (i mod 5 = li_ShiftLine) then begin Pen.Color := TColor($ff0000); if (i mod 10 = li_10Line) then begin MoveTo(li_Width, 0); LineTo(li_Width, FZoomSize.RulerSize.Height -2); end else begin MoveTo(li_Width, 0); LineTo(li_Width, FZoomSize.RulerSize.Height -4); end; end else if (FiZoom >= 2) then begin Pen.Color := clGray; MoveTo(li_Width, 0); LineTo(li_Width, FZoomSize.RulerSize.Height -5); end; end; //縦の目盛(線は横に引く) li_ShiftLine := FZoomSize.CopySize.Center.Y mod 5; li_10Line := FZoomSize.CopySize.Center.Y mod 10; for i := 0 to FZoomSize.HorizontalGrid do begin li_Height := i * FiZoom + FZoomSize.RulerSize.Height; //横線を引く位置 if (i = 0) then begin Pen.Color := clSilver; MoveTo(0, li_Height); LineTo(FZoomSize.RulerSize.Width, li_Height); end else if (i mod 5 = li_ShiftLine) then begin Pen.Color := TColor($ff0000); if (i mod 10 = li_10Line) then begin MoveTo(0, li_Height); LineTo(FZoomSize.RulerSize.Width -2, li_Height); end else begin MoveTo(0, li_Height); LineTo(FZoomSize.RulerSize.Width -4, li_Height); end; end else if (FiZoom >= 2) then begin Pen.Color := clGray; MoveTo(0, li_Height); LineTo(FZoomSize.RulerSize.Width -5, li_Height); end; end; //三角の赤マーカーを描画 if (FiZoom = 1) then begin li_ShiftColorPos := FiZoom div 2; end else begin li_ShiftColorPos := FiZoom div 2 -1; //より真ん中へ表示させるために-1 end; Pen.Color := clRed; Brush.Color := Pen.Color; Polygon([ Point(FrDispInfo.ptColorPos.X + li_ShiftColorPos, FZoomSize.RulerSize.Height -1), Point(FrDispInfo.ptColorPos.X + li_ShiftColorPos -2, FZoomSize.RulerSize.Height -3), Point(FrDispInfo.ptColorPos.X + li_ShiftColorPos +2, FZoomSize.RulerSize.Height -3) ]); Polygon([ Point(FZoomSize.RulerSize.Width -1, FrDispInfo.ptColorPos.Y + li_ShiftColorPos), Point(FZoomSize.RulerSize.Width -3, FrDispInfo.ptColorPos.Y + li_ShiftColorPos -2), Point(FZoomSize.RulerSize.Width -3, FrDispInfo.ptColorPos.Y + li_ShiftColorPos +2) ]); //ペンを元に戻す Pen.Color := TColor(Action_Grid_SelColor.Tag); end; end; { FSetDrawBkColor; FBitmapDraw.Canvas.FillRect(FrcInfo); //縦線 FBitmapDraw.Canvas.MoveTo(FiVLine, FrcInfo.Top + FiFontHeight +1); FBitmapDraw.Canvas.LineTo(FiVLine, ClientHeight); } Self.Tag := 1; Timer_InfomationTimer(nil); // DrawNow; end; //描画スタート・今すぐ描画 procedure TApp_BugsEye.DrawNow; begin if (Tag <> 0) then begin //myDebug.gpcDebug('DrawNow'); FiPassTime := 0; //すぐに再描画させたい為に間隔判定用のフラグを0にセットする。 Timer_MainTimer(Timer_Main); FSetCaptureRefleshTime(100); //描画後にマウスポインタが動いていなくても更新させる頻度を一度だけ低くする。 end; end; //------------------------------------------------------------------------------ //マウスカーソルのカーソルポイントを示すボックスを描く時の枠の幅を返す //倍率選択とグリッド色選択で使用する function TApp_BugsEye.FGetPointShift: Integer; begin if (Action_Grid_Disp.Checked) and (FiZoom >= FciMINGRID) then begin Result := 2; //グリッドの線を避けるため1ドット足して2 end else begin //※グリッドとカーソルボックスの線の引き方は違っている Result := 1; //グリッド表示がないので1ですむ end; end; procedure TApp_BugsEye.FSetToolButtonDown(AAction: TAction); var i: Integer; l_ToolButton : TToolButton; begin if (AAction = nil) then begin Exit; end; for i := 0 to ToolBar_Main.ButtonCount -1 do begin l_ToolButton := ToolBar_Main.Buttons[i]; if (l_ToolButton.Action = AAction) then begin l_ToolButton.Down := AAction.Checked; Exit; end; end; end; //倍率選択 procedure TApp_BugsEye.Action_ZoomExecute(Sender: TObject); var l_Action : TAction; l_MenuItem : TMenuItem; begin if not(Sender is TAction) then begin Exit; end; l_Action := TAction(Sender); l_MenuItem := TMenuItem(Self.FindComponent('MenuItem_' + Copy(l_Action.Name, Length('Action_') +1, MAXINT))); l_Action.Checked := True; FiZoom := Abs(l_Action.Tag); FiZoomIndex := l_MenuItem.MenuIndex; //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(l_Action); // if (gfnbFormExists(Form_Setting_Zoom)) if (gfnbFormExists(Form_Setting)) then begin // Form_Setting_Zoom.ZoomIndex := FiZoomIndex; Form_Setting.ZoomIndex := FiZoomIndex; end; FormResize(nil); end; //倍率の上下 procedure TApp_BugsEye.FZoom_UpDown(Sender: TObject); var li_Zoom: Integer; begin if (FiZoomBak > 0) then begin Exit; end; if (Sender = Action_Zoom_Up) then begin li_Zoom := 1; end else if (Sender = Action_Zoom_Down) then begin li_Zoom := -1; end else begin Exit; end; if ((li_Zoom = -1) and (FiZoomIndex <= 0)) //倍率が既に最低の時 or ((li_Zoom = 1) and (FiZoomIndex >= MenuItem_Zoom.Count -1)) //倍率が既に最高の時 then begin Exit; end; Action_ZoomExecute(MenuItem_Zoom.Items[gfniNumLimit(FiZoomIndex + li_Zoom, 0, MenuItem_Zoom.Count -1)].Action); end; procedure TApp_BugsEye.Action_Zoom_UpExecute(Sender: TObject); begin FZoom_UpDown(Action_Zoom_Up); end; procedure TApp_BugsEye.Action_Zoom_DownExecute(Sender: TObject); begin FZoom_UpDown(Action_Zoom_Down); end; //ホイールで倍率の上下 procedure TApp_BugsEye.FormMouseWheelDown(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); begin //FbThroughがTrueなら処理しきれないイベントを捨てる if (FbThrough) then begin //Exit; end; FbThrough := True; if (ssAlt in Shift) then begin //カーソル移動→ Action_Move_LeftExecute(Action_Move_Right); end else if (ssCtrl in Shift) then begin //カーソル移動↓ Action_Move_LeftExecute(Action_Move_Down); end else begin if (Action_Opt_ZoomWheel.Checked) then begin //倍率→高 FZoom_UpDown(Action_Zoom_Up); end else begin //倍率→低 FZoom_UpDown(Action_Zoom_Down); end; end; Handled := True; Application.ProcessMessages; //溜まってるイベントを捨てる FbThrough := False; end; procedure TApp_BugsEye.FormMouseWheelUp(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); begin //FbThroughがTrueなら処理しきれないイベントを捨てる if (FbThrough) then begin //Exit; end; FbThrough := True; if (ssAlt in Shift) then begin //カーソル移動← Action_Move_LeftExecute(Action_Move_Left); end else if (ssCtrl in Shift) then begin //カーソル移動↑ Action_Move_LeftExecute(Action_Move_Up); end else begin if (Action_Opt_ZoomWheel.Checked) then begin //倍率→低 FZoom_UpDown(Action_Zoom_Down); end else begin //倍率→高 FZoom_UpDown(Action_Zoom_Up); end; end; Handled := True; Application.ProcessMessages; //溜まってるキューを捨てる FbThrough := False; end; //------------------------------------------------------------------------------ (* procedure TApp_BugsEye.ToolBarButton_MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); //押された状態のツールボタンを押したままボタン外にマウスを移動させると押された状 //態がキャンセルされてしまうことへ対処。 var l_Button: TToolButton; l_Action: TAction; begin if (Sender is TToolButton) then begin l_Button := TToolButton(Sender); l_Action := TAction(l_Button.Action); if (l_Action <> nil) and (l_Action.Checked) then begin l_Button.Parent.Perform(TB_PRESSBUTTON, l_Button.Index, MakeLong(Ord(True), 0)); end; end; end; procedure TApp_BugsEye.ToolBarButton_MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure lpc_ButtonsDown(AToolBar: TToolBar); var i: Integer; begin for i := 0 to AToolBar.ButtonCount -1 do begin ToolBarButton_MouseUp(AToolBar.Buttons[i], mbLeft, [], 0, 0); //第一引数以外は適当でよい end; end; var l_Button: TToolButton; l_Action: TAction; begin Exit; if (Sender is TToolButton) then begin l_Button := TToolButton(Sender); l_Action := TAction(l_Button.Action); if (l_Action <> nil) and (l_Action.Checked) then begin ToolBarButton_MouseUp(TToolBar(Sender), mbLeft, [], 0, 0); //第一引数以外は適当でよい end else begin lpc_ButtonsDown(TToolBar(l_Button.Parent)); end; end else if (Sender is TToolBar) then begin lpc_ButtonsDown(TToolBar(Sender)); end; end; *) //------------------------------------------------------------------------------ //グリッド procedure TApp_BugsEye.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean); var l_ToolButton : TToolButton; l_Action : TAction; l_Rect : TRect; begin if (Msg.hwnd = Application.Handle) then begin //タスクバーのメニュー拡張 if (Msg.message = WM_SYSCOMMAND) then begin case Msg.wParam of lciMENU_OPTCUSTOMIZE: Action_Custom_SettingExecute(nil); lciMENU_MOVEMONITOR : Action_Move_MonitorExecute(nil); end; end; end else // if (Msg.hwnd = Self.Handle) // then begin begin //グリッドのツールボタン case Msg.message of WM_MOUSEMOVE :begin if (FToolButton_Grid = nil) then begin Exit; end; l_ToolButton := FToolButton_Grid; if (l_ToolButton.Tag <> 0) then begin l_Action := TAction(l_ToolButton.Action); if (l_Action = nil) // or (l_Action.Checked = False) then begin Exit; end; if (gfnbKeyState(VK_LBUTTON)) then begin //myDebug.gpcDebug(l_Action.Name, l_Action.Checked); if not(l_ToolButton.Down) then begin l_Rect := gfnrcOriginRect(l_ToolButton); if not(PtInRect(l_Rect, Msg.pt)) then begin ReleaseCapture; // NG l_ToolButton.Down := l_Action.Checked; PostMessage(Self.Handle, WM_APP, 0, LPARAM(l_ToolButton)); end; end; end else begin l_ToolButton.Tag := 0; //myDebug.gpcDebug(l_Action.Name, l_Action.Checked); //AIU if not(l_ToolButton.Down) then begin l_Rect := gfnrcOriginRect(l_ToolButton); if not(PtInRect(l_Rect, Msg.pt)) then begin ReleaseCapture; // NG l_ToolButton.Down := l_Action.Checked; PostMessage(Self.Handle, WM_APP, 0, LPARAM(l_ToolButton)); end; end; end; end; end; end; end; end; procedure TApp_BugsEye.WMApp(var Msg: TMessage); //ツールバーがtbsDropDownでも押されたらへこんだままのチェック状態になるようにするため var l_ToolButton : TToolButton; l_Action : TAction; begin l_ToolButton := TToolButton(Msg.LParam); if (l_ToolButton <> nil) then begin l_Action := TAction(l_ToolButton.Action); if (l_Action = nil) then begin Exit; end; l_ToolButton.Down := Action_Grid_Disp.Checked; end; end; procedure TApp_BugsEye.ToolButton_Grid_DispMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (Button = mbLeft) and (Sender is TToolButton) then begin FToolButton_Grid := TToolButton(Sender); FToolButton_Grid.Tag := 1; end; end; procedure TApp_BugsEye.ToolButton_Grid_DispMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (Button = mbLeft) then begin if (FToolButton_Grid <> nil) then begin FToolButton_Grid.Tag := 0; FToolButton_Grid := nil; end; PostMessage(Handle, WM_APP, 0, LPARAM(Sender)); end; end; procedure TApp_BugsEye.Action_Grid_DispExecute(Sender: TObject); //グリッド表示ON/OFF begin Action_Grid_Disp.Checked := not(Action_Grid_Disp.Checked); FormResize(nil); DrawNow; end; procedure TApp_BugsEye.Action_Grid_ColorExecute(Sender: TObject); //グリッド色、灰、黒、白 var l_Action : TAction; begin l_Action := TAction(Sender); l_Action.Checked := True; //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(l_Action); FclGridColor := TComponent(Sender).Tag; if (Sender = Action_Grid_Invert) then begin //反転色 FpmPenMode := pmNot; end else if (Sender = Action_Grid_Transparent) then begin //半透明 FpmPenMode := pmMask; end else begin FpmPenMode := pmCopy; end; DrawNow; end; procedure TApp_BugsEye.Action_Grid_SubColorExecute(Sender: TObject); //サブグリッド色、青・赤 var l_Action : TAction; begin l_Action := TAction(Sender); l_Action.Checked := True; //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(l_Action); if (Sender <> Action_Grid_SubNone) then begin FclGridSubColor := TComponent(Sender).Tag; Action_Grid_UseSubElseColorExecute(nil); end; DrawNow; end; procedure TApp_BugsEye.Action_Grid_SelColorExecute(Sender: TObject); //グリッド色、サブグリッド色選択 {Shift,Ctrl} var l_Action : TAction; l_clIniColor : TColor; lb_Shift : Boolean; lb_Ctrl : Boolean; lb_Disp : Boolean; begin if not(Action_Custom_Setting.Enabled) or not(Sender is TAction) then begin //App_BugsEyeSetting作成時 Exit; end; if (Sender = Action_Grid_SelColor) then begin l_clIniColor := FrIniData.clGridColor; end else if (Sender = Action_Grid_SelSubColor) then begin l_clIniColor := FrIniData.clGridSubColor; end else if (Sender = Action_Grid_SelSubElseColor) then begin l_clIniColor := FrIniData.clGridSubElseColor; end else begin Exit; end; l_Action := TAction(Sender); lb_Shift := gfnbKeyState(VK_SHIFT); lb_Ctrl := gfnbKeyState(VK_CONTROL); lb_Disp := False; if (lb_Shift) or (lb_Ctrl) then begin l_Action.Checked := True; if (lb_Shift and lb_Ctrl) then begin //初期値に戻す l_Action.Tag := l_clIniColor; end else if (lb_Ctrl) then begin //画面の色をグリッド色にセット l_Action.Tag := FrDispInfo.clColorRef; end else if (lb_Shift) then begin //画面の反転色をグリッド色にセット l_Action.Tag := gfnclColorRevers(FrDispInfo.clColorRef); end; end else begin ColorDialog.Color := TColor(l_Action.Tag); if (ColorDialog.Execute) then begin if (Sender <> Action_Grid_SelSubElseColor) then begin l_Action.Checked := True; end; l_Action.Tag := ColorDialog.Color; lb_Disp := True; end; end; if (Sender = Action_Grid_SelColor) or (Sender = Action_Grid_SelSubColor) then begin if (l_Action.Checked) then begin if (Sender = Action_Grid_SelColor) then begin FclGridColor := TColor(l_Action.Tag); end else if (Sender = Action_Grid_SelSubColor) then begin FclGridSubColor := TColor(l_Action.Tag); Action_Grid_UseSubElseColorExecute(nil); end; //グリッドが非表示なら表示させる Action_Grid_Disp.Checked := Action_Grid_Disp.Checked or (lb_Shift or lb_Ctrl or lb_Disp); end; end else {if (Sender = actGrid_SelSubElseColor) then} begin FclGridSubElseColor := TColor(l_Action.Tag); Action_Grid_UseSubElseColorExecute(nil); end; //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(l_Action); FormResize(nil); end; procedure TApp_BugsEye.Action_Grid_UseSubElseColorExecute(Sender: TObject); //サブグリッドに二色使う begin if (Action_Grid_UseSubElseColor.Checked) then begin //サブグリッドを二色使って引く FclGridSubElseColor := Action_Grid_SelSubElseColor.Tag; end else begin //サブグリッドは一色 FclGridSubElseColor := FclGridSubColor; end; DrawNow; end; //------------------------------------------------------------------------------ //カーソル位置 procedure TApp_BugsEye.Action_Pos_LengthPosSetExecute(Sender: TObject); //ユーザー指定座標の原点指定 {Ctrl,Shift+Ctrl} begin if (gfnbKeyState(VK_SHIFT) and gfnbKeyState(VK_CONTROL)) then begin //Shift+Ctrl+Spaceで(0, 0)にリセット FrDispInfo.ptLengthPos := Point(0, 0); end else if (gfnbKeyState(VK_CONTROL)) then begin //ユーザー指定座標の原点へカーソルを移動 MoveCursorToPoint(Action_Pos_LengthPosSet); end else begin if ((Action_Capture_Pause.Checked) or (Action_Capture_Fixed.Checked)) and not(gfnbKeyState(VK_SHIFT)) then begin FrDispInfo.ptLengthPos := FrDispInfo.ptMousePos end else begin FrDispInfo.ptLengthPos := gfnptMousePosGet; if not(Action_Pos_Length.Checked) then begin Action_Pos_Length.Checked := True; FormResize(nil); end; end; end; // if (gfnbFormExists(Form_Setting_Info)) if (gfnbFormExists(Form_Setting)) then begin // Form_Setting_Info.SpinEdit_Pos_UserX.Value := FrDispInfo.ptUserPos.X; // Form_Setting_Info.SpinEdit_Pos_UserY.Value := FrDispInfo.ptUserPos.Y; Form_Setting.SpinEdit_Pos_UserValue := FrDispInfo.ptLengthPos; end; DrawNow; end; //------------------------------------------------------------------------------ //ウィンドウ情報 { procedure TApp_BugsEye.Action_WinInfo_StyleExecute(Sender: TObject); begin Action_WinInfo_StyleVerboseExecute(nil); FormResize(nil); end; } procedure TApp_BugsEye.Action_WinInfo_StyleVerboseExecute(Sender: TObject); begin if (Application.Terminated) or (Self.Tag = 0) then begin Exit; end; {$IFNDEF PLUGIN} if (FIsActionEnabled(MenuItem_WinInfo_StyleVerbose)) then begin // if not(gfnbFormExists('App_BugsEyeWindowStyle')) if not(gfnbFormExists(App_BugsEyeWindowStyle)) then begin App_BugsEyeWindowStyle := TApp_BugsEyeWindowStyle.Create(Self); end; App_BugsEyeWindowStyle.Show; DrawNow; end else begin if (gfnbFormExists(App_BugsEyeWindowStyle)) then begin App_BugsEyeWindowStyle.Hide; // ShowWindow(App_BugsEyeWindowStyle.Handle, SW_HIDE); end; end; {$ENDIF} end; //------------------------------------------------------------------------------ procedure TApp_BugsEye.Action_Opt_StayOnTopExecute(Sender: TObject); //常に手前に表示 begin if (Action_Opt_StayOnTop.Checked) then begin Windows.SetWindowPos(Application.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE); end else begin Windows.SetWindowPos(Application.Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOACTIVATE); end; DrawNow; end; procedure TApp_BugsEye.Action_Opt_TitleBarExecute(Sender: TObject); //タイトルバー var li_Style : Longint; begin li_Style := GetWindowLong(Self.Handle, GWL_STYLE); if (Action_Opt_TitleBar.Checked) then begin if ((li_Style and WS_CAPTION) <> WS_CAPTION) then begin SetWindowLong(Self.Handle, GWL_STYLE, li_Style or WS_CAPTION or WS_THICKFRAME); end; end else begin if ((li_Style and WS_CAPTION) = WS_CAPTION) then begin li_Style := li_Style - WS_CAPTION; SetWindowLong(Self.Handle, GWL_STYLE, li_Style); end; end; if (Self.Tag <> 0) then begin SetWindowPos(Self.Handle, 0, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE or SWP_NOZORDER or SWP_FRAMECHANGED or SWP_NOACTIVATE); end; FormResize(nil); end; function TApp_BugsEye.FGetToolBarHeight: Integer; //ツールバーの高さを返す begin if not(Action_Opt_ToolBar.Checked) then begin Result := 0; end else begin Result := Panel_ToolBar.Height; end; end; procedure TApp_BugsEye.Action_Opt_ToolBarExecute(Sender: TObject); //ツールバー begin if (Action_Opt_ToolBar.Checked) {and not(Action_Opt_HideToolBar.Checked)} then begin //ツールバーあり Panel_ToolBar.Visible := True; end else begin //ツールバー無し Panel_ToolBar.Visible := False; end; FormResize(nil); end; procedure TApp_BugsEye.Action_Capture_NoSelfCaptureExecute(Sender: TObject); //自分自身をキャプチャしない begin if not(gfnbIsAlphaBlendReady) then begin Action_Capture_NoSelfCapture.Checked := False; AlphaBlend := False; Exit; end; FCheckAeroThemeEnabled(Action_Capture_NoSelfCapture); AlphaBlend := FIsActionEnabled(MenuItem_Capture_NoSelfCapture); ToolBar_Main.DoubleBuffered := AlphaBlend; Sleep(100); //少し経ってからでないと最初の一度だけうまくキャプチャできない DrawNow; end; procedure TApp_BugsEye.Action_Opt_SelFontExecute(Sender: TObject); //フォント選択 const lci_VLINELIMIT = 8; begin FontDialog1.Font := FBitmapDraw.Canvas.Font; if (Sender <> nil) and (FontDialog1.Execute) then begin FBitmapDraw.Canvas.Font := FontDialog1.Font; end; FiFontHeight := Trunc(FBitmapDraw.Canvas.TextHeight('A') * 1.2) +1; //ラインを引くため下に1ピクセル余裕を持たせる FiInfoLeft := FiFontHeight + FBitmapDraw.Canvas.TextWidth(Format(FGetDispFmt(G_ciFMTZOOM), [FiZoom])) + 4; //4ピクセル離す // FiVLine := (FBitmapDraw.Canvas.TextWidth('A') * G_ciMAXDISPITEM) + (FBitmapDraw.Canvas.TextWidth('A') div 2); FiVLine := gfniNumLimit(FiVLine, lci_VLINELIMIT, Self.ClientWidth - lci_VLINELIMIT); {$IFNDEF PLUGIN} if (gfnbFormExists(App_BugsEyeAPITest)) then begin App_BugsEyeAPITest.SetTextSize(App_BugsEye.DrawFont); end; if (gfnbFormExists(App_BugsEyeWindowStyle)) then begin App_BugsEyeWindowStyle.SetTextSize; end; {$ENDIF} FormResize(nil); end; function TApp_BugsEye.FGetDrawFont: TFont; begin Result := FBitmapDraw.Canvas.Font; end; //------------------------------------------------------------------------------ function TApp_BugsEye.FGetMoveAction(AAction: TAction): TAction; begin case FrDispInfo.fpCapture_ZoomFlip of fpFlipHorizontal :begin if (AAction = Action_Move_Left) then begin Result := Action_Move_Right; end else if (AAction = Action_Move_Right) then begin Result := Action_Move_Left; end else begin Result := AAction; end; end; fpFlipVertical :begin if (AAction = Action_Move_Up) then begin Result := Action_Move_Down; end else if (AAction = Action_Move_Down) then begin Result := Action_Move_Up; end else begin Result := AAction; end; end; fpFlipBoth, fpRotate180 :begin if (AAction = Action_Move_Left) then begin Result := Action_Move_Right; end else if (AAction = Action_Move_Right) then begin Result := Action_Move_Left; end else if (AAction = Action_Move_Up) then begin Result := Action_Move_Down; end else if (AAction = Action_Move_Down) then begin Result := Action_Move_Up; end else begin //AIU Result := AAction; end; end; fpRotate90 :begin if (AAction = Action_Move_Left) then begin Result := Action_Move_Up; end else if (AAction = Action_Move_Right) then begin Result := Action_Move_Down; end else if (AAction = Action_Move_Up) then begin Result := Action_Move_Left; end else if (AAction = Action_Move_Down) then begin Result := Action_Move_Right; end else begin //AIU Result := AAction; end; end; fpRotate270 :begin if (AAction = Action_Move_Left) then begin Result := Action_Move_Up; end else if (AAction = Action_Move_Right) then begin Result := Action_Move_Down; end else if (AAction = Action_Move_Up) then begin Result := Action_Move_Right; end else if (AAction = Action_Move_Down) then begin Result := Action_Move_Left; end else begin //AIU Result := AAction; end; end; else Result := AAction; end; end; procedure TApp_BugsEye.Timer_CaptureMoveTimer(Sender: TObject); var li_KeySpeed : DWORD; l_Action : TAction; begin if (FMoveButton = SpeedButton_Capture_MoveLeft) then begin l_Action := FGetMoveAction(Action_Move_Left); end else if (FMoveButton = SpeedButton_Capture_MoveRight) then begin l_Action := FGetMoveAction(Action_Move_Right); end else if (FMoveButton = SpeedButton_Capture_MoveUp) then begin l_Action := FGetMoveAction(Action_Move_Up); end else if (FMoveButton = SpeedButton_Capture_MoveDown) then begin l_Action := FGetMoveAction(Action_Move_Down); end else begin Exit; end; l_Action.OnExecute(l_Action); DrawNow; //http://mrxray.on.coocan.jp/Delphi/plSamples/S04_SystemParametersInfo_Interface.htm#03 if not(SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, @li_KeySpeed, 0)) then begin li_KeySpeed := 100; end; Timer_CaptureMove.Interval := 400 - (li_KeySpeed * 12); if not(gfnbKeyState(VK_LBUTTON)) then begin Timer_CaptureMove.Enabled := False; end; end; procedure TApp_BugsEye.SpeedButton_Capture_MoveLeftMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var li_Delay: DWORD; begin if not(Sender is TSpeedButton) then begin Exit; end; FMoveButton := TSpeedButton(Sender); Timer_CaptureMoveTimer(nil); //http://mrxray.on.coocan.jp/Delphi/plSamples/S04_SystemParametersInfo_Interface.htm#03 if not(SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, @li_Delay, 0)) then begin li_Delay := 250; end; Timer_CaptureMove.Interval := (li_Delay +1) * 250; Timer_CaptureMove.Enabled := True; end; procedure TApp_BugsEye.SpeedButton_Capture_MoveLeftMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin Timer_CaptureMove.Enabled := False; end; //定点キャプチャ、一時停止の文字列を一定時間表示した後元に戻す procedure TApp_BugsEye.Timer_InfomationTimer(Sender: TObject); begin FsInfomation := ''; Timer_Infomation.Enabled := False; DrawNow; end; //一時停止 procedure TApp_BugsEye.Action_Capture_PauseExecute(Sender: TObject); procedure _CaptureNoSelf(DC: HDC); begin //自身は含まないデスクトップ FBitmapNoSelf.Width := MyScreenSize.ScreenWidth; FBitmapNoSelf.Height := MyScreenSize.ScreenHeight; // FBitmapNoSelf.Canvas.Brush.Color := FrDispInfo.clOpt_BkColor; FBitmapNoSelf.Canvas.FillRect(Rect(0, 0, FBitmapNoSelf.Width, FBitmapNoSelf.Height)); Windows.BitBlt( FBitmapNoSelf.Canvas.Handle, 0, 0, FBitmapNoSelf.Width, FBitmapNoSelf.Height, DC, MyScreenSize.ScreenLeft, MyScreenSize.ScreenTop, SRCCOPY ); end; procedure _CaptureDesktop(DC: HDC); begin //自身も含めたデスクトップ FBitmapDesktop.Width := MyScreenSize.ScreenWidth; FBitmapDesktop.Height := MyScreenSize.ScreenHeight; // FBitmapDesktop.Canvas.Brush.Color := FrDispInfo.clOpt_BkColor; FBitmapDesktop.Canvas.FillRect(Rect(0, 0, FBitmapDesktop.Width, FBitmapDesktop.Height)); Windows.BitBlt( FBitmapDesktop.Canvas.Handle, 0, 0, FBitmapDesktop.Width, FBitmapDesktop.Height, DC, MyScreenSize.ScreenLeft, MyScreenSize.ScreenTop, SRCCOPY or CAPTUREBLT ); end; var ldc_Desktop: HDC; begin if (gfnbKeyState(VK_CONTROL)) then begin MoveCursorToPoint(Sender); Exit; end else if (gfnbKeyState(VK_SHIFT)) then begin FSetPoint; Exit; end; //↑の処理があるためAutoCheckをTrueにできない if (Sender <> Action_Capture_Update) then begin Action_Capture_Pause.Checked := not(Action_Capture_Pause.Checked); end; Action_Capture_Update.Enabled := Action_Capture_Pause.Checked; if (Action_Capture_Pause.Checked) then begin if (Action_Capture_Lupe.Checked) then begin Timer_Main.Enabled := True; end else begin Timer_Main.Enabled := False; end; end else begin Timer_Main.Enabled := True; end; if (gfnbFormExists(G_SettingCaptureForm)) then begin G_SettingCaptureForm.SpinEdit_Capture_FixedEnabled := (Action_Capture_Fixed.Checked or Action_Capture_Pause.Checked); end; {$IFNDEF PLUGIN} if (gfnbFormExists(App_BugsEyeWindowStyle)) // if (gfnbFormExists('App_BugsEyeWindowStyle')) then begin with App_BugsEyeWindowStyle do begin if (Action_Capture_Pause.Checked) then begin //一時停止時は薄黄色 ListBox_Style.Color := clInfoBk; ListBox_Style.Font.Color := clInfoText; Memo_Hint.Visible := True; Splitter1.Visible := True; end else begin ListBox_Style.Color := clWindow; ListBox_Style.Font.Color := clWindowText; Splitter1.Visible := False; Memo_Hint.Visible := False; end; end; end; {$ENDIF} if (Action_Capture_Pause.Checked) then begin Action_Capture_Pause.Tag := 1; DrawNow; //↓の処理に少し時間がかかるため先に一時停止の状態表示にする。 MyScreenSize.Reflesh; if not(Action_Capture_NoSelfCapture.Checked) and (Action_Capture_NoSelfCapture.Enabled) then begin AlphaBlend := True; end; //全ウィンドウの情報をリストに保持 FreeAndNil(FWinList); //AIU FWinList := T_WinList.Create; ldc_Desktop := CreateDC('DISPLAY', nil, nil, nil); try _CaptureDesktop(ldc_Desktop); // if (Action_Capture_Lupe.Enabled) // then begin _CaptureNoSelf(ldc_Desktop); // end; finally DeleteDC(ldc_Desktop); end; if not(Action_Capture_NoSelfCapture.Checked) and (Action_Capture_NoSelfCapture.Enabled) then begin AlphaBlend := False; end; Action_Capture_Pause.Tag := 0; end else begin //一時停止中にモニター情報が変わったかもしれないので更新する MyScreenSize.Reflesh; FWinList.Free; FWinList := nil; if (FiZoomBak > 0) then begin FiZoom := FiZoomBak; FiZoomBak := -1; end; Action_Capture_NoSelfCapture.Enabled := True; end; FSetPanelVisible; FCheckAeroThemeEnabled(nil); { Action_Write_ColorRGB.Enabled := Action_Capture_Pause.Checked; Action_Write_ColorRGBRed.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorRGBGreen.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorRGBBlue.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHTML.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorCOLORREF.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHSV.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHSVHUE.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHSVSATURATION.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHSVVALUE.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLS.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLSHUE.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLSSATURATION.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLSLIGHTNESS.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLSWIN.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLSWINHUE.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLSWINSATURATION.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_ColorHLSWINLIGHTNESS.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosScreen.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosScreenX.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosScreenY.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosMonitor.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosMonitorX.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosMonitorY.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosClient.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosClientX.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosClientY.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosUser.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosUserWidth.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_PosUserHeight.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoHandle.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoClassName.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoText.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoWindowSize.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoWindowSizeLeft.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoWindowSizeTop.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoWindowSizeWidth.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoWindowSizeHeight.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoClientSize.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoClientSizeWidth.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoClientSizeHeight.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoRect.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoRectLeft.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoRectTop.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoRectRIGHT.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoRectBOTTOM.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoControlID.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoStyle.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoStyleEx.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoPID.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoExeName.Enabled := Action_Write_ColorRGB.Enabled; Action_Write_WinInfoFileVersion.Enabled := Action_Write_ColorRGB.Enabled; } Timer_InfomationTimer(Sender); FormResize(nil); DrawNow; //FormResizeでやっているので不要と思うのだけれど、一時停止のときに真っ白になることがあるので必要 end; procedure TApp_BugsEye.Action_Capture_UpdateExecute(Sender: TObject); //更新 begin if not(Action_Capture_Pause.Checked) then begin Exit; end; Action_Capture_PauseExecute(Action_Capture_Update); end; procedure TApp_BugsEye.FSetCapturePosX(iX: Integer); var lr_Monitor : TMyMonitorPos; begin FrDispInfo.ptMousePos.X := iX; lr_Monitor := gfnrScreenToMonitor(MyScreenSize, FrDispInfo.ptMousePos); if (lr_Monitor.MonitorNum = 0) and (FiMonitorNum > 0) //AIU then begin FrDispInfo.ptMousePos.X := gfniNumLimit(FrDispInfo.ptMousePos.X, MyScreenSize.MonitorsRect[FiMonitorNum -1].Left, MyScreenSize.MonitorsRect[FiMonitorNum -1].Right -1); end else begin FiMonitorNum := lr_Monitor.MonitorNum; end; DrawNow; end; procedure TApp_BugsEye.FSetCapturePosY(iY: Integer); var lr_Monitor : TMyMonitorPos; begin FrDispInfo.ptMousePos.Y := iY; lr_Monitor := gfnrScreenToMonitor(MyScreenSize, FrDispInfo.ptMousePos); if (lr_Monitor.MonitorNum = 0) and (FiMonitorNum > 0) //AIU then begin FrDispInfo.ptMousePos.Y := gfniNumLimit(FrDispInfo.ptMousePos.Y, MyScreenSize.MonitorsRect[FiMonitorNum -1].Top, MyScreenSize.MonitorsRect[FiMonitorNum -1].Bottom -1); end else begin FiMonitorNum := lr_Monitor.MonitorNum; end; DrawNow; end; procedure TApp_BugsEye.Action_Capture_LupeExecute(Sender: TObject); //ルーペモード/ウィンドウ下のデスクトップ画面をキャプチャ begin if not(gfnbIsAlphaBlendReady) then begin //2000未満はAlphaBlendには非対応なので処理を抜ける。 Exit; end; FCheckAeroThemeEnabled(Action_Capture_Lupe); if (Action_Capture_Lupe.Checked) then begin //ルーペモード //AlphaBlendをTrueにセットする必要があるので「自身をキャプチャしない」を無効にする // Action_Capture_NoSelfCapture.Enabled := False; if not(Self.AlphaBlend) then begin Self.AlphaBlend := True; end; //設定一覧のキャプチャポイントのエディットボックスを選択不可状態にする。 if (gfnbFormExists(G_SettingCaptureForm)) then begin G_SettingCaptureForm.SpinEdit_Capture_FixedEnabled := False; end; end else begin //「自身をキャプチャしない」の無効を戻す。 // Action_Capture_NoSelfCapture.Enabled := True; if not(Action_Capture_NoSelfCapture.Checked) then begin //自身をキャプチャする設定になっていた Self.AlphaBlend := False; end; //設定一覧のキャプチャポイントのエディットボックスを選択不可状態にする if (gfnbFormExists(G_SettingCaptureForm)) then begin G_SettingCaptureForm.SpinEdit_Capture_FixedEnabled := Action_Capture_Pause.Checked; end; end; FSetPanelVisible; DrawNow; end; procedure TApp_BugsEye.Action_Capture_FixedExecute(Sender: TObject); //定点キャプチャ //マウスカーソルに追従せず一点をキャプチャし続ける begin if (gfnbKeyState(VK_CONTROL)) then begin MoveCursorToPoint(Sender); Exit; end else if (gfnbKeyState(VK_SHIFT)) then begin FSetPoint; Exit; end; //↑の処理があるためAutoCheckをTrueにできない Action_Capture_Fixed.Checked := not(Action_Capture_Fixed.Checked); Action_Capture_LupeExecute(nil); // FrDispInfo.ptPhysicalMousePos := gfnptMousePosGet; FSetPanelVisible; Application.ProcessMessages; if (gfnbFormExists(G_SettingCaptureForm)) then begin G_SettingCaptureForm.SpinEdit_Capture_FixedValue := FrDispInfo.ptMousePos; G_SettingCaptureForm.SpinEdit_Capture_FixedEnabled := (Action_Capture_Fixed.Checked or Action_Capture_Pause.Checked); end; Timer_InfomationTimer(Sender); DrawNow; end; procedure TApp_BugsEye.Action_Capture_SmoothCaptureExecute(Sender: TObject); //スムースキャプチャ //マウスカーソルを動かしていない時でもキャプチャを間引かない begin { if (actOpt_SmoothCapture.Checked) then begin Timer_Main.Interval := FiCapture_SmoothInterval; end else begin Timer_Main.Interval := FiCapture_Interval; end; } if (Sender <> nil) then begin Timer_InfomationTimer(Sender); end; DrawNow end; procedure TApp_BugsEye.Action_Capture_MoveCursorToPointExecute(Sender: TObject); begin MoveCursorToPoint(Sender); end; procedure TApp_BugsEye.Action_Capture_PointFromCursorExecute(Sender: TObject); begin FSetPoint; end; function TApp_BugsEye.FGetDispFmt(iIndex: Integer): String; //表示用形式文字列を返す begin if (iIndex < 0) or (iIndex > G_ciFMTCOUNT) then begin Result := ''; end else begin Result := G_csDISPFMT[iIndex, G_ciDISP_INFO]; end; end; function TApp_BugsEye.FGetCopyFmt(iIndex : Integer) : String; begin Result := ''; if (iIndex < 0) or (iIndex > G_ciFMTCOUNT) then begin Exit; end; Result := FsCopyFmt[iIndex]; end; procedure TApp_BugsEye.FSetCopyFmt(iIndex : Integer; sFmt : String); begin if (iIndex < 0) or (iIndex > G_ciFMTCOUNT) then begin Exit; end; FsCopyFmt[iIndex] := sFmt; end; //コピー function TApp_BugsEye.FGetInitCopyFmt(iIndex: Integer): String; begin Result := ''; if (iIndex < 0) or (iIndex > G_ciFMTCOUNT) then begin Exit; end; Result := G_csINITCOPYFMT[iIndex]; end; function TApp_BugsEye.FGetCopyZoomGrid: Boolean; begin Result := (Copy(App_BugsEye.CopyFmt[G_ciFMTZOOM], 1, 1) <> '0'); //10の位 end; function TApp_BugsEye.FGetCopyZoomInfo: Boolean; begin Result := (Copy(App_BugsEye.CopyFmt[G_ciFMTZOOM], 2, 1) <> '0'); //1の位 end; function TApp_BugsEye.FGetInitCopyZoomGrid: Boolean; begin Result := (Copy(App_BugsEye.InitCopyFmt[G_ciFMTZOOM], 1, 1) <> '0'); //10の位 end; function TApp_BugsEye.FGetInitCopyZoomInfo: Boolean; begin Result := (Copy(App_BugsEye.InitCopyFmt[G_ciFMTZOOM], 2, 1) <> '0'); //1の位 end; //キャプチャ procedure TApp_BugsEye.FSetCaptureInterval(iTime: Integer); begin FiCapture_Interval := gfniNumLimit(iTime, 1, 1000); if not(Action_Capture_SmoothCapture.Checked) then Timer_Main.Interval := iTime; end; procedure TApp_BugsEye.FSetCaptureSmoothInterval(iTime: Integer); begin FiCapture_SmoothInterval := gfniNumLimit(iTime, 1, 1000); if (Action_Capture_SmoothCapture.Checked) then Timer_Main.Interval := iTime; end; procedure TApp_BugsEye.FSetCaptureRefleshTime(iTime: Integer); begin FiCapture_RefleshTime := gfniNumLimit(iTime, 1, 60000); end; procedure TApp_BugsEye.FSetPanelVisible; begin Panel_CaptureMove.Visible := Action_Capture_Fixed.Checked or Action_Capture_Pause.Checked or Action_Capture_Lupe.Checked ; end; procedure TApp_BugsEye.FCapture_KeyDown; //実寸表示にする begin if (FiZoomBak < 0) then begin //キーを押している間だけ倍率を1倍にする FiZoomBak := FiZoom; FiZoom := 1; FiPassTime := 0; FormResize(nil); end; end; procedure TApp_BugsEye.FCapture_KeyUp; //↑を元に戻す begin if (FiZoomBak > 0) then begin FiZoom := FiZoomBak; FiZoomBak := -1; FiPassTime := 0; FormResize(nil); //初期化 FptMove_x1 := Point(-3200, -3200); end; end; procedure TApp_BugsEye.btnToolCapture_Disp_x1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var lpt_Pos: TPoint; begin if (Button <> mbLeft) then begin Exit; end; //一時的に実寸表示にする lpt_Pos := gfnptMousePosGet; // FptMove := Point(lpt_Pos.X - (lpt_Pos.X - Left), lpt_Pos.Y - (lpt_Pos.Y - Top)); FptMove_x1 := Point( lpt_Pos.X - Left, lpt_Pos.Y - Top ); FCapture_KeyDown; ReleaseCapture; SendMessage(Handle, WM_SYSCOMMAND, WPARAM(SC_SIZE or 9), 0); end; procedure TApp_BugsEye.btnToolCapture_Disp_x1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); //var // lpt_Pos: TPoint; begin ReleaseCapture; //実寸表示しつつウィンドウを移動させる if (FiZoomBak > 0) then begin if (gfnbKeyState(VK_LBUTTON)) then begin // lpt_Pos := gfnptMousePosGet; // SetWindowPos(Self.Handle, 0, lpt_Pos.X - F_ptMove_x1.X, lpt_Pos.Y - F_ptMove_x1.Y, 0, 0, SWP_NOZORDER or SWP_NOSIZE or SWP_NOREDRAW or SWP_NOACTIVATE); // DrawNow; end else begin FCapture_KeyUp; end; end; end; procedure TApp_BugsEye.btnToolCapture_Disp_x1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin //実寸表示を元に戻す FCapture_KeyUp; end; procedure TApp_BugsEye.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); var i: Integer; l_Action: TAction; begin if (ssAlt in Shift) then begin Exit; end; //------------------------------------------------------------------------------ //準汎用フォーム用 for i := 0 to G_ShortCutList.Count -1 do begin if (Key = T_ShortCutAction(G_ShortCutList.Items[i]).Key) then begin l_Action := T_ShortCutAction(G_ShortCutList.Items[i]).Action; if (l_Action = Action_Move_Up) or (l_Action = Action_Move_Down) or (l_Action = Action_Move_Left) or (l_Action = Action_Move_Right) then begin if (Action_Move_OptMoveBitmap.Checked) then begin l_Action := FGetMoveAction(l_Action); end; l_Action.OnExecute(l_Action); end else if (l_Action = Action_Capture_Disp_x1) then begin FCapture_KeyDown; end; Key := 0; Exit; end; end; //------------------------------------------------------------------------------ end; procedure TApp_BugsEye.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); var i: Integer; l_Action: TAction; begin //------------------------------------------------------------------------------ //準汎用フォーム用 if (Key = VK_APPS) then begin Action_Menu_MainExecute(Action_Menu_Main); Key := 0; end else begin if not(ssAlt in Shift) then begin for i := 0 to G_ShortCutList.Count -1 do begin if (Key = T_ShortCutAction(G_ShortCutList.Items[i]).Key) then begin l_Action := T_ShortCutAction(G_ShortCutList.Items[i]).Action; if (l_Action = Action_Move_Up) or (l_Action = Action_Move_Down) or (l_Action = Action_Move_Left) or (l_Action = Action_Move_Right) then begin //KeyDownで処理済なのでここでは何もしない end else if (l_Action = Action_Capture_Disp_x1) then begin FCapture_KeyUp; end else begin if (l_Action.AutoCheck) then begin l_Action.Checked := not(l_Action.Checked); end; if (@l_Action.OnExecute <> nil) then begin l_Action.OnExecute(l_Action); end; end; Key := 0; Exit; end; end; end; end; //------------------------------------------------------------------------------ end; procedure TApp_BugsEye.FCapture_MovePoint(ptPos: TPoint); const lci_Threshold = 5; lci_Wait = 40; var i, li_Start, li_Time: DWORD; begin if ((Abs(ptPos.X - FrDispInfo.ptMousePos.X) > lci_Threshold) or (Abs(ptPos.Y - FrDispInfo.ptMousePos.Y) > lci_Threshold)) then begin //移動をアニメーション li_Start := Windows.GetTickCount; for i := 1 to lci_Threshold -1 do begin FrDispInfo.ptMousePos := Point( FrDispInfo.ptMousePos.X + gfniRound(((ptPos.X - FrDispInfo.ptMousePos.X) / lci_Threshold) * i), FrDispInfo.ptMousePos.Y + gfniRound(((ptPos.Y - FrDispInfo.ptMousePos.Y) / lci_Threshold) * i) ); DrawNow; li_Time := Windows.GetTickCount; if (li_Start + (i * lci_Wait) > li_Time) then begin Windows.Sleep(li_Start + (i * lci_Wait) - li_Time); end; end; end; FrDispInfo.ptMousePos := ptPos; Timer_InfomationTimer(nil); DrawNow; end; procedure TApp_BugsEye.FormDblClick(Sender: TObject); //ダブルクリックした点をキャプチャポジションにする var lpt_Pos : TPoint; lr_Monitor : TMyMonitorPos; begin if (Action_Capture_Pause.Checked) or (Action_Capture_Fixed.Checked) then begin { lpt_Pos := Point( gfniNumLimit(FrDispInfo.ptPhysicalMousePos.X + (FptDragClientPos.X - FZoomSize.RulerSize.Width) div FiZoom - FszDesktop.Left, MyScreenSize.ScreenLeft, MyScreenSize.ScreenWidth -1), gfniNumLimit(FrDispInfo.ptPhysicalMousePos.Y + (FptDragClientPos.Y - FiRulerWidth - FGetToolBarHeight) div FiZoom - FszDesktop.Top, MyScreenSize.ScreenTop, MyScreenSize.ScreenHeight -1) ); } lpt_Pos := Point( gfniNumLimit(FrDispInfo.ptMousePos.X + (FptDragClientPos.X - FZoomSize.RulerSize.Width) div FiZoom - FZoomSize.CopySize.Center.X, MyScreenSize.ScreenLeft, MyScreenSize.ScreenWidth -1), gfniNumLimit(FrDispInfo.ptMousePos.Y + (FptDragClientPos.Y - FZoomSize.RulerSize.Height - FGetToolBarHeight) div FiZoom - FZoomSize.CopySize.Center.Y, MyScreenSize.ScreenTop, MyScreenSize.ScreenHeight -1) ); lr_Monitor := gfnrScreenToMonitor(MyScreenSize, lpt_Pos); if ((lpt_Pos.X <> FrDispInfo.ptMousePos.X) or ( lpt_Pos.Y <> FrDispInfo.ptMousePos.Y)) //前回から動いていて and (lr_Monitor.MonitorNum >= 0) //モニターの範囲内 then begin FCapture_MovePoint(lpt_Pos); end; end; end; procedure TApp_BugsEye.MoveCursorToPoint(Sender: TObject); //マウスカーソルをキャプチャポイントへ移動 const lci_Threshold = 10; lci_Wait = 10; var i, li_Start, li_Time: DWORD; lpt_Cursor, lpt_Point: TPoint; begin //定点キャプチャ・一時停止時 if (Sender = Action_Pos_LengthPosSet) then begin //ユーザー指定の原点 lpt_Point := FrDispInfo.ptLengthPos; end else if (Action_Capture_Fixed.Checked) or (Action_Capture_Pause.Checked) then begin //一時停止か定点キャプチャ時 lpt_Point := FrDispInfo.ptMousePos; end else begin //それ以外の場合はあまり意味がないので処理を抜ける Exit; end; lpt_Cursor := gfnptMousePosGet; if (Abs(lpt_Cursor.X - lpt_Point.X) > lci_Threshold) or (Abs(lpt_Cursor.Y - lpt_Point.Y) > lci_Threshold) then begin //カーソルを瞬時に移動させるのではなく残像を見せつつ移動させる li_Start := Windows.GetTickCount; for i := 1 to lci_Threshold -1 do begin Windows.SetCursorPos( lpt_Cursor.X - gfniRound(((lpt_Cursor.X - lpt_Point.X) / lci_Threshold) * i), lpt_Cursor.Y - gfniRound(((lpt_Cursor.Y - lpt_Point.Y) / lci_Threshold) * i) ); li_Time := Windows.GetTickCount; if (li_Start + (i * lci_Wait) > li_Time) then begin Windows.Sleep(li_Start + (i * lci_Wait) - li_Time); end; end; end; Windows.SetCursorPos(lpt_Point.X, lpt_Point.Y); end; procedure TApp_BugsEye.FSetPoint; //現在のマウスカーソルの位置をキャプチャポイントに設定 begin //定点キャプチャ・一時停止時 if (Action_Capture_Fixed.Checked) or (Action_Capture_Pause.Checked) then begin FCapture_MovePoint(gfnptMousePosGet); end; end; //------------------------------------------------------------------------------ procedure TApp_BugsEye.Action_HelpExecute(Sender: TObject); //バージョン情報 begin G_pcCreateHelpForm; G_pcSetTabSheet(G_CustomForm.tabHelp); end; procedure TApp_BugsEye.Action_File_MinimizeExecute(Sender: TObject); //最小化 begin Application.Minimize; end; procedure TApp_BugsEye.Action_File_ExitExecute(Sender: TObject); //終了 begin Close; end; //============================================================================== procedure TApp_BugsEye.FPushInfomation(sText: WideString); //1行情報表示へ情報をプッシュ begin FsInfomation := sText; Timer_Infomation.Enabled := True; DrawNow; end; function TApp_BugsEye.FIsActionEnabled(AMenuItem: TMenuItem): Boolean; begin Result := AMenuItem.Checked // and AMenuItem.Visible and AMenuItem.Enabled ; end; (* function TApp_BugsEye.FGetColorName(clColor: TColor): String; begin case clColor of $0F5474: Result := '藍色'; $FFD800: Result := 'イエロー'; // $BB8B38: Result := 'イエローオーカー'; // $B2D235: Result := 'イエローグリーン'; // $F36C21: Result := 'イエローレッド'; // $F1E266: Result := '硫黄色'; $BAB454: Result := '威光茶'; $B45460: Result := '苺色'; $F9AE94: Result := '一斤染'; $C75467: Result := '今様色'; $7D415E: Result := '暗紅色'; $003F8E: Result := 'インクブルー'; $F69679: Result := 'インディアンレッド'; $074770: Result := 'インディゴ'; $F26649: Result := 'ヴァーミリオン'; $905740: Result := 'ヴァンダイクブラウン'; $8689C3: Result := 'ウィステリア'; $a5c9c1: Result := 'ウォーターグリーン'; $AFDFE4: Result := 'ウォーターブルー'; $918D40: Result := '鶯色'; $6D5826: Result := '鶯茶'; $FDB933: Result := 'ウコン色'; $97C3D0: Result := '薄藍'; $93b69c: Result := '薄青'; $FDE8E9: Result := '薄色'; $BAA4C4: Result := '薄色'; $F69896: Result := '薄紅'; $6283C2: Result := '薄群青'; $F2DFBB: Result := '薄香'; $F6BABC: Result := '薄紅梅'; $939598: Result := '薄墨色'; $FEDCBD: Result := '薄橙'; $FFEFCF: Result := '薄卵色'; $C5956B: Result := '薄茶'; $B1B3B6: Result := '薄鈍色'; $928E9E: Result := '薄鼠'; $6EA4CA: Result := '薄花色'; $ADCDEC: Result := '薄花桜'; $9BC9D5: Result := '薄縹'; $67A7CC: Result := '浅縹'; $CEE6C1: Result := '薄緑'; $948060: Result := '空五倍子色'; $f7fcfe: Result := '卯の花色'; $B97E5A: Result := '梅染'; $B9909E: Result := '梅鼠'; $D3E8C1: Result := '裏葉柳'; $465DAA: Result := 'ウルトラマリンブルー'; $D75F55: Result := '潤朱'; $F4E0C4: Result := '亜麻色'; $C38559: Result := '江戸茶'; $6D5498: Result := '江戸紫'; $30583B: Result := 'エバーグリーン'; // $691C2A: Result := '海老色'; $691C2A: Result := '葡萄色'; $7E5767: Result := '葡萄染'; $7C4036: Result := '海老茶'; $474931: Result := 'エボニー'; $00B379: Result := 'エメラルドグリーン'; $7A903E: Result := 'エルムグリーン'; $B3424A: Result := '臙脂色'; $E66B58: Result := '鉛丹色'; // $EDF0E0: Result := 'オイスターホワイト'; $769164: Result := '老竹色'; $C69E6E: Result := '黄褐色'; $9B92C6: Result := '楝色'; $BA8448: Result := '黄土色'; $F47A55: Result := '黄丹'; $B2D235: Result := '黄緑色'; $BB8B38: Result := 'オーカー'; // $1A4472: Result := '狼色'; $D2A3CB: Result := 'オーキッド'; $D5848C: Result := 'オールドローズ'; $007C8A: Result := '御納戸色'; $2A6E6B: Result := '御納戸茶'; $B4DDC0: Result := 'オパールグリーン'; $848455: Result := '御召茶'; $6D5F1A: Result := 'オリーブ色'; $576128: Result := 'オリーブグリーン'; $6E6339: Result := 'オリーブドラブ'; $3155A6: Result := 'オリエンタルブルー'; $F58220: Result := 'オレンジ色'; $f68b1e: Result := 'オレンジ色'; //か $B18B55: Result := 'カーキー'; $B1221A: Result := 'カーディナルレッド'; $691C23: Result := 'ガーネット'; $D11C2C: Result := 'カーマイン'; $E6E7E8: Result := '灰白色'; $5B8063: Result := '灰緑色'; $8AC75A: Result := '海緑色'; $F3704B: Result := '柿色'; $EDF0E0: Result := '牡蠣色'; $B45332: Result := '柿茶'; $4B5EAA: Result := '杜若色'; // $FCBB76: Result := '萱草色'; $4D5269: Result := '勝色'; $2B4C5A: Result := '褐返し'; $843900: Result := '褐色'; $FAC61E: Result := 'カドミウムイエロー'; $FFEF6C: Result := 'カナリーイエロー'; $AE5039: Result := '樺色'; // $AE5039: Result := '蒲色'; $995D46: Result := '樺茶'; $94D6DA: Result := '瓶覗'; $006956: Result := '鴨の羽色'; $D71345: Result := '唐紅'; $C9AB53: Result := '芥子色'; $180614: Result := '烏羽色'; $90563C: Result := '枯茶'; $F0DC70: Result := '苅安色'; // $D11C2C: Result := 'カルミン'; $E7C694: Result := '枯草色'; $3D5C4C: Result := '革色'; $B77055: Result := '土器色'; $FAA755: Result := '柑子色'; $FCBB76: Result := '萱草色'; $58535E: Result := 'ガンメタルグレイ'; //き $FFD400: Result := '黄色'; $F36C21: Result := '黄赤'; $7E5435: Result := '黄枯茶'; $585EAA: Result := '桔梗色'; $7D8361: Result := '麹塵'; $DE773F: Result := '黄茶'; $C27526: Result := '狐色'; $BB8C58: Result := '黄橡'; $F6F5EA: Result := '生成色'; $FCF16E: Result := '黄蘗色'; // $B2D235: Result := '黄緑'; $BB8D5F: Result := 'キャメル'; $E4AB7B: Result := '伽羅色'; $DD6B3D: Result := 'キャロットオレンジ'; $825C8C: Result := '京紫'; $EF4123: Result := '金赤'; // $A1A3A6: Result := '銀灰色'; // $F26649: Result := '銀朱'; $E0861A: Result := '金茶'; $A1A3A6: Result := '銀鼠'; //く $6D8346: Result := '草色'; $FFD768: Result := '梔子色'; $896A45: Result := '朽葉色'; // $6D8346: Result := 'グラスグリーン'; $FFEDB3: Result := 'クリーム色'; $722F10: Result := '栗色'; $624722: Result := '涅色'; $00B16B: Result := 'グリーン'; $883B28: Result := '栗梅'; $DC143C: Result := 'クリムゾン'; $B76F43: Result := '胡桃色'; $77787B: Result := 'グレー'; $C22047: Result := '紅色'; $2A2A2A: Result := '黒'; $005344: Result := '鉄色'; //け $4D4D4F: Result := '消炭色'; $5C3B54: Result := '滅紫'; $57462B: Result := '憲法色'; //こ $0D2A52: Result := '濃藍'; $584F5B: Result := '濃鼠'; $D1AC76: Result := '香色'; $954C93: Result := '紅紫'; $EC008C: Result := '紅紫色'; // $FAA755: Result := '柑子色'; $F69C9F: Result := '紅梅色'; $816229: Result := '黄櫨染'; $7D4A31: Result := 'コーヒーブラウン'; // $F8A7A0: Result := 'コーラルレッド'; $FBB161: Result := 'ゴールデンイエロー'; $B27737: Result := 'ゴールデンオリーブ'; $B36D4D: Result := '焦香'; $6C4851: Result := '濃色'; $274765: Result := '深縹'; $c9171e: Result := '深緋'; $806830: Result := '国防色'; $63822D: Result := '苔色'; $6B493D: Result := '焦茶'; $875647: Result := 'ココアブラウン'; $7D5484: Result := '古代紫'; $C53258: Result := 'コチニールレッド'; // $584F5B: Result := '濃鼠'; $B76F3B: Result := '琥珀色'; $40BA8D: Result := 'コバルトグリーン'; $0072BC: Result := 'コバルトブルー'; $6E673F: Result := '媚茶'; $FFFEF9: Result := '胡粉色'; $E19661: Result := '小麦色'; $BA8D65: Result := 'コルク'; $464A88: Result := '紺藍'; $233B6C: Result := '紺色'; $1A4472: Result := '紺青'; $694F94: Result := '金青'; $0F1A45: Result := '紺鉄'; $5AB9C1: Result := '金春色'; $224B8F: Result := '紺瑠璃'; //さ $ee7948: Result := 'サーモンピンク'; $FEEEED: Result := '桜色'; $2E87A1: Result := 'サックスブルー'; $508A88: Result := '錆浅葱'; $6A3427: Result := '錆色'; $395A5B: Result := '錆鼠'; $0054A6: Result := 'サファイアブルー'; $FFCC40: Result := 'サフランイエロー'; $CEC5F0: Result := 'サフラン色'; $F1E266: Result := 'サルファーイエロー'; $F8A7A0: Result := '珊瑚色'; $D3C6A6: Result := 'サンドベージュ'; $577244: Result := 'サップグリーン'; //し $00AEEF: Result := 'シアン'; $8AC75A: Result := 'シーグリーン'; $235BC8: Result := 'シーブルー'; $3F9877: Result := 'ジェードグリーン'; $FDDDCD: Result := 'シェルピンク'; $FFCC4E: Result := '雌黄'; $757199: Result := '紫苑色'; $4D5269: Result := '飾磨紺'; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; $: Result := ''; else Result := ''; end; end; *) function TApp_BugsEye.FGetColorName(clColor: TColor): String; begin case clColor of $CD5C5C: Result := 'IndianRed'; $F08080: Result := 'LightCoral'; $FA8072: Result := 'Salmon'; $E9967A: Result := 'DarkSalmon'; $FFA07A: Result := 'LightSalmon'; $DC143C: Result := 'Crimson'; $FF0000: Result := 'Red'; $B22222: Result := 'FireBrick'; $8B0000: Result := 'DarkRed'; $FFC0CB: Result := 'Pink'; $FFB6C1: Result := 'LightPink'; $FF69B4: Result := 'HotPink'; $FF1493: Result := 'DeepPink'; $C71585: Result := 'MediumVioletRed'; $DB7093: Result := 'PaleVioletRed'; $FF7F50: Result := 'Coral'; $FF6347: Result := 'Tomato'; $FF4500: Result := 'OrangeRed'; $FF8C00: Result := 'DarkOrange'; $FFA500: Result := 'Orange'; $FFD700: Result := 'Gold'; $FFFF00: Result := 'Yellow'; $FFFFE0: Result := 'LightYellow'; $FFFACD: Result := 'LemonChiffon'; $FAFAD2: Result := 'LightGoldenrodYellow'; $FFEFD5: Result := 'PapayaWhip'; $FFE4B5: Result := 'Moccasin'; $FFDAB9: Result := 'PeachPuff'; $EEE8AA: Result := 'PaleGoldenrod'; $F0E68C: Result := 'Khaki'; $BDB76B: Result := 'DarkKhaki'; $E6E6FA: Result := 'Lavender'; $D8BFD8: Result := 'Thistle'; $DDA0DD: Result := 'Plum'; $EE82EE: Result := 'Violet'; $DA70D6: Result := 'Orchid'; $FF00FF: Result := 'Fuchsia/Magenta'; $BA55D3: Result := 'MediumOrchid'; $9370DB: Result := 'MediumPurple'; $9966CC: Result := 'Amethyst'; $8A2BE2: Result := 'BlueViolet'; $9400D3: Result := 'DarkViolet'; $9932CC: Result := 'DarkOrchid'; $8B008B: Result := 'DarkMagenta'; $800080: Result := 'Purple'; $4B0082: Result := 'Indigo'; $6A5ACD: Result := 'SlateBlue'; $483D8B: Result := 'DarkSlateBlue'; $7B68EE: Result := 'MediumSlateBlue'; $ADFF2F: Result := 'GreenYellow'; $7FFF00: Result := 'Chartreuse'; $7CFC00: Result := 'LawnGreen'; $00FF00: Result := 'Lime'; $32CD32: Result := 'LimeGreen'; $98FB98: Result := 'PaleGreen'; $90EE90: Result := 'LightGreen'; $00FA9A: Result := 'MediumSpringGreen'; $00FF7F: Result := 'SpringGreen'; $3CB371: Result := 'MediumSeaGreen'; $2E8B57: Result := 'SeaGreen'; $228B22: Result := 'ForestGreen'; $008000: Result := 'Green'; $006400: Result := 'DarkGreen'; $9ACD32: Result := 'YellowGreen'; $6B8E23: Result := 'OliveDrab'; $808000: Result := 'Olive'; $556B2F: Result := 'DarkOliveGreen'; $66CDAA: Result := 'MediumAquamarine'; $8FBC8F: Result := 'DarkSeaGreen'; $20B2AA: Result := 'LightSeaGreen'; $008B8B: Result := 'DarkCyan'; $008080: Result := 'Teal'; $00FFFF: Result := 'Aqua/Cyan'; $E0FFFF: Result := 'LightCyan'; $AFEEEE: Result := 'PaleTurquoise'; $7FFFD4: Result := 'Aquamarine'; $40E0D0: Result := 'Turquoise'; $48D1CC: Result := 'MediumTurquoise'; $00CED1: Result := 'DarkTurquoise'; $5F9EA0: Result := 'CadetBlue'; $4682B4: Result := 'SteelBlue'; $B0C4DE: Result := 'LightSteelBlue'; $B0E0E6: Result := 'PowderBlue'; $ADD8E6: Result := 'LightBlue'; $87CEEB: Result := 'SkyBlue'; $87CEFA: Result := 'LightSkyBlue'; $00BFFF: Result := 'DeepSkyBlue'; $1E90FF: Result := 'DodgerBlue'; $6495ED: Result := 'CornflowerBlue'; $4169E1: Result := 'RoyalBlue'; $0000FF: Result := 'Blue'; $0000CD: Result := 'MediumBlue'; $00008B: Result := 'DarkBlue'; $000080: Result := 'Navy'; $191970: Result := 'MidnightBlue'; $FFF8DC: Result := 'Cornsilk'; $FFEBCD: Result := 'BlanchedAlmond'; $FFE4C4: Result := 'Bisque'; $FFDEAD: Result := 'NavajoWhite'; $F5DEB3: Result := 'Wheat'; $DEB887: Result := 'BurlyWood'; $D2B48C: Result := 'Tan'; $BC8F8F: Result := 'RosyBrown'; $F4A460: Result := 'SandyBrown'; $DAA520: Result := 'Goldenrod'; $B8860B: Result := 'DarkGoldenrod'; $CD853F: Result := 'Peru'; $D2691E: Result := 'Chocolate'; $8B4513: Result := 'SaddleBrown'; $A0522D: Result := 'Sienna'; $A52A2A: Result := 'Brown'; $800000: Result := 'Maroon'; $FFFFFF: Result := 'White'; $FFFAFA: Result := 'Snow'; $F0FFF0: Result := 'Honeydew'; $F5FFFA: Result := 'MintCream'; $F0FFFF: Result := 'Azure'; $F0F8FF: Result := 'AliceBlue'; $F8F8FF: Result := 'GhostWhite'; $F5F5F5: Result := 'WhiteSmoke'; $FFF5EE: Result := 'Seashell'; $F5F5DC: Result := 'Beige'; $FDF5E6: Result := 'OldLace'; $FFFAF0: Result := 'FloralWhite'; $FFFFF0: Result := 'Ivory'; $FAEBD7: Result := 'AntiqueWhite'; $FAF0E6: Result := 'Linen'; $FFF0F5: Result := 'LavenderBlush'; $FFE4E1: Result := 'MistyRose'; $DCDCDC: Result := 'Gainsboro'; $D3D3D3: Result := 'LightGrey'; $C0C0C0: Result := 'Silver'; $A9A9A9: Result := 'DarkGray'; $808080: Result := 'Gray'; $696969: Result := 'DimGray'; $778899: Result := 'LightSlateGray'; $708090: Result := 'SlateGray'; $2F4F4F: Result := 'DarkSlateGray'; $000000: Result := 'Black'; else Result := ''; end; end; //ptPosの点上にある可視ウィンドウを返す。 function TApp_BugsEye.FGetWindow(ptPos: TPoint): HWND; type T_TopWindow = record hTop : HWND; pPoint : TPoint; bNoSelfCapture : Boolean; bLoope : Boolean; end; P_TopWindow = ^T_TopWindow; function _EnumChildProc(hHandle: HWND; pTopWindow: Pointer): BOOL; stdcall; var lh_Parent: HWND; begin Result := True; if (IsWindowVisible(hHandle)) // and (PtInRect(gfnrcWindowRectGet(hHandle), T_TopWindow(pTopWindow^).pPoint)) and (PtInRect(gfnrcPhysicalWindowRectGet(hHandle), T_TopWindow(pTopWindow^).pPoint)) then begin lh_Parent := gfnhParentWindowGet(hHandle); if (lh_Parent = T_TopWindow(pTopWindow^).hTop) then begin //直前に列挙された対象ウィンドウの子ウィンドウだった //hTopを書き換える //子ウィンドウがあるかもしれないので処理を続ける T_TopWindow(pTopWindow^).hTop := hHandle; end else begin //親ウィンドウが同じなら兄弟ウィンドウ。 //しかし列挙されるのは手前のウィンドウからなのでその場合はhTopは書き換ず処理を抜ける。 //親ウィンドウが直前のウィンドウでもない //おじさんおばさんウィンドウ、あるいはさらに遡ってのウィンドウであるのでこれまたhTopを書き換えず処理を抜ける Result := False; end; end; end; function _EnumWindowsProc(hHandle: HWND; pTopWindow: Pointer):BOOL; stdcall; //トップレベルウィンドウを列挙する var lrg_Region: HRGN; lpt_Pos: TPoint; lrc_Rect, lrc_Client: TRect; begin //トップレベルウィンドウは物理座標で返る lrc_Rect := gfnrcWindowRectGet(hHandle); if (IsWindowVisible(hHandle)) //可視ウィンドウのみ and (PtInRect(lrc_Rect, T_TopWindow(pTopWindow^).pPoint)) //ウィンドウのRect内にマウスカーソルがある then begin if (T_TopWindow(pTopWindow^).bNoSelfCapture) and ((GetWindowLong(hHandle, GWL_EXSTYLE) and WS_EX_LAYERED) = WS_EX_LAYERED) then begin //自身をキャプチャしない設定で対象ウィンドウがレイヤードである場合キャプチャできていないので次のウィンドウに処理を移す Result := True; end else if (T_TopWindow(pTopWindow^).bLoope) and (hHandle = App_BugsEye.Handle) then begin //ルーペモード Result := True; end else begin Result := False; lrg_Region := CreateRectRgn(0, 0, 0, 0); try if (GetWindowRgn(hHandle, lrg_Region) <> ERROR) then begin lpt_Pos.X := T_TopWindow(pTopWindow^).pPoint.X - lrc_Rect.Left; lpt_Pos.Y := T_TopWindow(pTopWindow^).pPoint.Y - lrc_Rect.Top; if (PtInRegion(lrg_Region, lpt_Pos.X, lpt_Pos.Y)) then begin //リージョン内だったので処理を抜ける end else begin //リージョン外だったので処理を続ける Result := True; end; end; finally DeleteObject(lrg_Region); end; if (Result = False) then begin T_TopWindow(pTopWindow^).hTop := hHandle; lrc_Client := gfnrcClientRectGet(hHandle); if (lrc_Client.Right > 0) or (lrc_Client.Bottom > 0) then begin EnumChildWindows(hHandle, @_EnumChildProc, LPARAM(pTopWindow)); end; end; end; end else begin Result := True; end; end; var lr_TopWindow : T_TopWindow; lh_Toplevel : HWND; li_ExStyle : DWORD; li_ColorKey : COLORREF; li_Alpha : BYTE; li_Flag : DWORD; begin if (FIsActionEnabled(MenuItem_Capture_NoSelfCapture)) or (FIsActionEnabled(MenuItem_Capture_Lupe)) then begin //ルーペモード FillChar(lr_TopWindow, SizeOf(lr_TopWindow), 0); lr_TopWindow.pPoint := ptPos; lr_TopWindow.bNoSelfCapture := FIsActionEnabled(MenuItem_Capture_NoSelfCapture); lr_TopWindow.bLoope := FIsActionEnabled(MenuItem_Capture_Lupe); EnumWindows(@_EnumWindowsProc, LPARAM(@lr_TopWindow)); Result := lr_TopWindow.hTop; end else begin Result := WindowFromPoint(ptPos); { if (Result = ChildWindowFromPoint(Result, gfnptScreenToClient(Result, ptPos))) then begin Exit; end; } FillChar(lr_TopWindow, SizeOf(lr_TopWindow), 0); lr_TopWindow.pPoint := ptPos; EnumWindows(@_EnumWindowsProc, LPARAM(@lr_TopWindow)); // lh_Handle2 := lr_TopWindow.hTop; //WindowFromPoint APIで取得したハンドルとEnumWindows APIで取得したハンドルを比較する。 if (Result <> lr_TopWindow.hTop) then begin //違っていたらEnumWindows APIで取得したウィンドウのスタイルを調べる。 //WS_EX_TRANSPARENTとWS_EX_LAYEREDが同時にセットされていたら見えていても //WindowFromPoint APIでは取得できないウィンドウなのでこちらを返す。 lh_Toplevel := GetAncestor(lr_TopWindow.hTop, GA_ROOT); li_ExStyle := GetWindowLong(lh_Toplevel, GWL_EXSTYLE); if ((li_ExStyle and WS_EX_LAYERED) = WS_EX_LAYERED) and ((li_ExStyle and WS_EX_TRANSPARENT) = WS_EX_TRANSPARENT) then begin if (GetLayeredWindowAttributes(lh_Toplevel, li_ColorKey, li_Alpha, li_Flag)) then begin if ((li_Flag and LWA_ALPHA) = LWA_ALPHA) and (li_Alpha = 0) then begin Exit; end; end; end; //2015-09-29:この上のend;の上に置いていた為EnabledがFalseのウィンドウを補足しなくなっていたミスを修正。 Result := lr_TopWindow.hTop; end; end; end; { procedure TApp_BugsEye.FSetDrawBkColor; begin //情報表示枠の塗りつぶし if (GetActiveWindow <> Self.Handle) then begin //フォームがアクティブでなければ灰色表示 FBitmapDraw.Canvas.Brush.Color := clBtnFace; FBitmapDraw.Canvas.Font.Color := clBtnText; FBitmapDraw.Canvas.Pen.Color := clBtnShadow; end else if (Action_Capture_Pause.Checked) then begin //一時停止時は薄黄色 FBitmapDraw.Canvas.Brush.Color := clInfoBk; FBitmapDraw.Canvas.Font.Color := clInfoText; FBitmapDraw.Canvas.Pen.Color := clBtnFace; end else begin FBitmapDraw.Canvas.Brush.Color := clWindow; FBitmapDraw.Canvas.Font.Color := clWindowText; FBitmapDraw.Canvas.Pen.Color := clBtnFace; end; // FBitmapDraw.Canvas.FillRect(FrcInfo); end; } procedure TApp_BugsEye.Timer_MainTimer(Sender: TObject); const //情報表示欄に引くラインのマージン。どれだけ文字から離すか lci_LINEMARGIN = 2; lci_MARGINLEFT = 2; const //ステータス表示の位置(順序) lci_INFO_WRITECASH = 0; lci_INFO_STAYONTOP = 1; lci_INFO_SMOOTH = 2; lci_INFO_PAUSE = 3; lci_INFO_LUPE = 4; lci_INFO_FIX = 5; const lci_SUBGRID = 5; //サブグリッドの間隔 lci_SUBELSEGRID = 2; //サブグリッドを違う色で引く間隔 lci_GRIDMARGIN = 1; //倍率が低いときのグリッドとカーソルポイントとの間隔 var i : Integer; li_TickCount : DWORD; //マウスカーソルが動いていない時にキャプチャを間引くために必要 lpt_Pos : TPoint; l_WinItem : T_WinItem; lrc_Rect : TRect; li_Width : Integer; li_Height : Integer; //グリッド li_BoxLen : Integer; //マウスカーソルのボックス用 li_ShiftLine : Integer; li_10Line : Integer; lb_ElseColor : Boolean; //マウスカーソル位置の色をボックスに表示するため lcl_BackColor : TColor; //キャプチャ ldc_Desktop : HDC; li_Rop : DWORD; begin if (Application.Terminated) then begin Timer_Main.Enabled := False; Exit; end; Application.ProcessMessages; if (FbThroughTimer) then begin Exit; end; FbThroughTimer := True; //モードによってキャプチャポイントが変わるのでここでlpt_Posにセット。 if (Action_Capture_Lupe.Checked) and (Action_Capture_Lupe.Enabled) then begin //F_szZoomは拡大画像の大きさであって拡大画面の大きさではないことに注意。 //拡大画像は拡大率によって若干ながらも大きさが変動するので拡大画面の中心を得たい今回のような用途には使えない。 lpt_Pos.X := -1 + Self.ClientOrigin.X + FZoomSize.RulerSize.Width + gfniRound((ClientWidth - FZoomSize.RulerSize.Width) / 2); lpt_Pos.Y := -1 + Self.ClientOrigin.Y + FGetToolBarHeight + FZoomSize.RulerSize.Height + gfniRound((ClientHeight - FGetToolBarHeight - FZoomSize.RulerSize.Height - gfniRectHeight(FrcInfo)) / 2); //なぜ-1なのか分からないのだけれど等倍の時にずれるのでその分を補正。 end else if (Action_Capture_Fixed.Checked) or (Action_Capture_Pause.Checked) then begin //一時停止と固定キャプチャ lpt_Pos := FrDispInfo.ptMousePos; end else begin lpt_Pos := gfnptPhysicalCursorPosGet; end; li_TickCount := Windows.GetTickCount; if (lpt_Pos.X <> FrDispInfo.ptMousePos.X) or (lpt_Pos.Y <> FrDispInfo.ptMousePos.Y) //前回表示の時と今回とマウスカーソルの位置が違っている。 or (FiPassTime = 0) //経過時間が0である。 or (Abs(li_TickCount - FiPassTime) > FiCapture_RefleshTime) //前回描画時からリフレッシュ時間を過ぎている。 or (Action_Capture_SmoothCapture.Checked) //スムーズキャプチャ(間引き無し) then begin //上記のどれかに合致したらば↓の処理に入る。 with FrDispInfo do begin ptMousePos := lpt_Pos; // FBitmapDraw.Canvas.Brush.Color := clOpt_BkColor; // FBitmapDraw.Canvas.FillRect(Rect(FZoomSize.RulerSize.Width, FZoomSize.RulerSize.Height, ClientWidth, FrcInfo.Top)); // FBitmapCopy.Canvas.Brush.Color := clOpt_BkColor; // FBitmapCopy.Canvas.Brush.Style := bsCapture_Brush; Windows.SetBkColor(FBitmapCopy.Canvas.Handle, FrDispInfo.iTest_BrushBkColor); FBitmapCopy.Canvas.FillRect(Rect(0, 0, FZoomSize.SquareSize.Size.Width, FZoomSize.SquareSize.Size.Width)); li_Rop := iCapture_Rop; if (Action_Capture_Pause.Checked) and (Action_Capture_Pause.Tag = 0) then begin //一時停止とズーム画像コピーのとき if (FIsActionEnabled(MenuItem_Capture_Lupe)) or (FIsActionEnabled(MenuItem_Capture_NoSelfCapture)) and (gfnbIsAlphaBlendReady) then begin //自身をキャプチャしない ldc_Desktop := FBitmapNoSelf.Canvas.Handle; end else begin ldc_Desktop := FBitmapDesktop.Canvas.Handle; end; BitBlt( FBitmapCopy.Canvas.Handle, 0, 0, FZoomSize.SquareSize.Size.Width, FZoomSize.SquareSize.Size.Height, ldc_Desktop, ptMousePos.X - FZoomSize.SquareSize.Center.X - MyScreenSize.ScreenLeft, ptMousePos.Y - FZoomSize.SquareSize.Center.Y - MyScreenSize.ScreenTop, li_Rop ); end else begin if (FIsActionEnabled(MenuItem_Capture_NoSelfCapture)) or (FIsActionEnabled(MenuItem_Capture_Lupe)) then begin //自身をキャプチャしない⇒レイヤードウィンドウをキャプチャしない end else begin //自身をキャプチャする⇒レイヤードウィンドウもキャプチャする li_Rop := li_Rop or CAPTUREBLT; end; ldc_Desktop := CreateDC('DISPLAY', nil, nil, nil); try BitBlt( FBitmapCopy.Canvas.Handle, 0, 0, FZoomSize.SquareSize.Size.Width, FZoomSize.SquareSize.Size.Height, ldc_Desktop, ptMousePos.X - FZoomSize.SquareSize.Center.X, ptMousePos.Y - FZoomSize.SquareSize.Center.Y, li_Rop ); finally DeleteDC(ldc_Desktop); end; end; //反転・回転(ここで拡大もできるのかもしれない) gpcImageRotate(FBitmapCopy.Canvas.Handle, 0, 0, FZoomSize.SquareSize.Size.Width, FZoomSize.SquareSize.Size.Height, fpCapture_ZoomFlip); //拡大 StretchBlt( FBitmapDraw.Canvas.Handle, FZoomSize.RulerSize.Width, FZoomSize.RulerSize.Height, FZoomSize.ZoomSize.Width, FZoomSize.ZoomSize.Height, FBitmapCopy.Canvas.Handle, FZoomSize.SquareSize.Origin.X, FZoomSize.SquareSize.Origin.Y, FZoomSize.SquareSize.Size.Width, FZoomSize.SquareSize.Size.Height, SRCCOPY ); //グリッド描画 if (Action_Grid_Disp.Checked) then begin if (FiZoom >= FciMINGRID) then begin //ペンをセット FBitmapDraw.Canvas.Pen.Color := FclGridColor; FBitmapDraw.Canvas.Pen.Mode := FpmPenMode; //縦線を引く for i := 0 to FZoomSize.VerticalGrid do begin li_Width := i * FiZoom + FZoomSize.RulerSize.Width; FBitmapDraw.Canvas.MoveTo(li_Width, FZoomSize.RulerSize.Height); FBitmapDraw.Canvas.LineTo(li_Width, FrcInfo.Top); end; //横線を引く for i := 0 to FZoomSize.HorizontalGrid do begin li_Height := i * FiZoom + FZoomSize.RulerSize.Height; FBitmapDraw.Canvas.MoveTo(FZoomSize.RulerSize.Width, li_Height); FBitmapDraw.Canvas.LineTo(ClientWidth, li_Height); end; //サブグリッドを引く if not(Action_Grid_SubNone.Checked) then begin FBitmapDraw.Canvas.Pen.Color := FclGridSubColor; FBitmapDraw.Canvas.Pen.Mode := pmCopy; //縦線を引く //キャプチャポイントを中心にしてサブグリッドを引くため li_ShiftLine := (FZoomSize.CopySize.Center.X mod lci_SUBGRID) * FiZoom; li_10Line := gfniRoundUp(FZoomSize.VerticalGrid / 2 / lci_SUBGRID) mod lci_SUBELSEGRID; for i := 0 to FZoomSize.VerticalGrid div lci_SUBGRID do begin li_Width := FZoomSize.RulerSize.Width + li_ShiftLine + (i * FiZoom * lci_SUBGRID); lb_ElseColor := ((i mod lci_SUBELSEGRID) = li_10Line); if (lb_ElseColor) then begin FBitmapDraw.Canvas.Pen.Color := FclGridSubElseColor; end; FBitmapDraw.Canvas.MoveTo(li_Width, FZoomSize.RulerSize.Height); FBitmapDraw.Canvas.LineTo(li_Width, FrcInfo.Top); if (lb_ElseColor) then begin FBitmapDraw.Canvas.Pen.Color := FclGridSubColor; end; end; //横線を引く //キャプチャポイントを中心にしてサブグリッドを引くため li_ShiftLine := (FZoomSize.CopySize.Center.Y mod lci_SUBGRID) * FiZoom; li_10Line := gfniRoundUp(FZoomSize.HorizontalGrid / 2 / lci_SUBGRID) mod lci_SUBELSEGRID; for i := 0 to FZoomSize.HorizontalGrid div lci_SUBGRID do begin li_Height := FZoomSize.RulerSize.Height + li_ShiftLine + (i * FiZoom * lci_SUBGRID); lb_ElseColor := ((i mod lci_SUBELSEGRID) = li_10Line); if (lb_ElseColor) then begin FBitmapDraw.Canvas.Pen.Color := FclGridSubElseColor; end; FBitmapDraw.Canvas.MoveTo(FZoomSize.RulerSize.Width, li_Height); FBitmapDraw.Canvas.LineTo(ClientWidth, li_Height); if (lb_ElseColor) then begin FBitmapDraw.Canvas.Pen.Color := FclGridSubColor; end; end; end; end else begin //倍率が低くてグリッドを引けないのでキャプチャポイントのグリッドだけ引く //枠線を引く //ペンをセット FBitmapDraw.Canvas.Pen.Color := FclGridColor; FBitmapDraw.Canvas.Pen.Mode := FpmPenMode; //枠の縦線を引く li_Width := FZoomSize.RulerSize.Width; FBitmapDraw.Canvas.MoveTo(li_Width, FZoomSize.RulerSize.Height); FBitmapDraw.Canvas.LineTo(li_Width, FrcInfo.Top); //枠の横線を引く li_Height := FZoomSize.RulerSize.Height; FBitmapDraw.Canvas.MoveTo(FZoomSize.RulerSize.Width, li_Height); FBitmapDraw.Canvas.LineTo(ClientWidth, li_Height); //中心線を引く if not(Action_Grid_SubNone.Checked) then begin //サブグリッドあり FBitmapDraw.Canvas.Pen.Color := FclGridSubColor; FBitmapDraw.Canvas.Pen.Mode := pmCopy; end; //縦線を引く FBitmapDraw.Canvas.MoveTo(ptColorPos.X, FZoomSize.RulerSize.Height); FBitmapDraw.Canvas.LineTo(ptColorPos.X, ptColorPos.Y - FGetPointShift - lci_GRIDMARGIN); FBitmapDraw.Canvas.MoveTo(ptColorPos.X, ptColorPos.Y + FiZoom + FGetPointShift + lci_GRIDMARGIN); FBitmapDraw.Canvas.LineTo(ptColorPos.X, FrcInfo.Top); //横線を引く FBitmapDraw.Canvas.MoveTo(FZoomSize.RulerSize.Width, ptColorPos.Y); FBitmapDraw.Canvas.LineTo(ptColorPos.X - FGetPointShift - lci_GRIDMARGIN, ptColorPos.Y); FBitmapDraw.Canvas.MoveTo(ptColorPos.X + FiZoom + FGetPointShift + lci_GRIDMARGIN, ptColorPos.Y); FBitmapDraw.Canvas.LineTo(ClientWidth, ptColorPos.Y); end; end; //現在のマウスカーソルのポイント表示 li_BoxLen := FiZoom + FGetPointShift; FBitmapDraw.Canvas.Pen.Mode := pmNot; li_Width := ptColorPos.X - FGetPointShift; li_Height := ptColorPos.Y - FGetPointShift; FBitmapDraw.Canvas.PolyLine([ Point(li_Width , li_Height), Point(li_Width + li_BoxLen, li_Height), //→ Point(li_Width + li_BoxLen, li_Height + li_BoxLen), //↓ Point(li_Width , li_Height + li_BoxLen), //← Point(li_Width , li_Height) //↑ ]); FBitmapDraw.Canvas.Pen.Mode := pmCopy; //情報表示---------------------------------------------------------------------- //カラー値は表示させていなくてもコピーで使うことがあるのでここに置く clColorRef := FBitmapDraw.Canvas.Pixels[ptColorPos.X, ptColorPos.Y]; iRed := clColorRef and $0000FF; iGreen := clColorRef and $00FF00 div $000100; iBlue := clColorRef and $FF0000 div $010000; clColor := (iRed * $010000) + (iGreen * $000100) + iBlue; //ウィンドウ情報 if (Action_Capture_Pause.Checked) //一時停止 and (Action_Capture_Pause.Tag = 0) //一時停止の始めに時間のかかる処理を行うので、その場合はこの中に入らない then begin if (FWinList <> nil) then begin //一時停止中は保持しておいたデータの方を参照する。 l_WinItem := FWinList.FindWindowItem( ptMousePos, (FIsActionEnabled(MenuItem_Capture_NoSelfCapture)) or (FIsActionEnabled(MenuItem_Capture_Lupe)) ); if (l_WinItem <> nil) then begin hWinHandle := l_WinItem.Handle; sWinClass := l_WinItem.WinClassName; sWinText := l_WinItem.Text; szWindowSize := l_WinItem.WindowSize; szClientSize := l_WinItem.ClientSize; ptClientPos := l_WinItem.ClientPos; rcWinRect := l_WinItem.BoundsRect; iControlID := l_WinItem.ControlID; iStyle := l_WinItem.Style; iStyleEx := l_WinItem.StyleEx; bEnabled := l_WinItem.Enabled; hParentHandle := l_WinItem.Parent.Handle; sParentClassName := l_WinItem.Parent.WinClassName; sParentText := l_WinItem.Parent.Text; iProcessID := l_WinItem.ProcessID; sExeName := l_WinItem.ExeName; sFileVersion := l_WinItem.FileVersion; end else begin hWinHandle := 0; sWinClass := ''; sWinText := ''; FillChar(szWindowSize, SizeOf(szWindowSize), 0); FillChar(szClientSize, SizeOf(szClientSize), 0); ptClientPos := Point(0, 0); rcWinRect := Rect(0, 0, 0, 0); iControlID := 0; iStyle := 0; iStyleEx := 0; bEnabled := False; hParentHandle := 0; sParentClassName := ''; sParentText := ''; iProcessID := 0; sExeName := ''; sFileVersion := ''; end; end; end else begin //表示させていないものでも一時停止時に表示させることができるのでこの位置でセット ptClientPos := ptMousePos; hWinHandle := FGetWindow(ptMousePos); //クライアント座標 Windows.ScreenToClient(hWinHandle, ptClientPos); ptClientPos := Point(ptMousePos.X - ptClientPos.X, ptMousePos.Y - ptClientPos.Y); LogicalToPhysicalPoint(hWinHandle, ptClientPos); sWinClass := gfnsClassNameGet(hWinHandle); sWinText := gfnsWindowTextGet(hWinHandle); //親ウィンドウのハンドル hParentHandle := gfnhParentWindowGet(hWinHandle); sParentClassName := gfnsClassNameGet(hParentHandle); sParentText := gfnsWindowTextGet(hParentHandle); lrc_Rect := gfnrcWindowRectGet(hWinHandle); rcWinRect := lrc_Rect; // lpt_Pos := lrc_Rect.TopLeft; // Windows.ScreenToClient(hParentHandle, lpt_Pos); lpt_Pos := gfnptScreenToClient(hParentHandle, lrc_Rect.TopLeft); with szWindowSize do begin Left := lpt_Pos.X; Top := lpt_Pos.Y; Width := lrc_Rect.Right - lrc_Rect.Left; Height := lrc_Rect.Bottom - lrc_Rect.Top; end; Windows.GetClientRect(hWinHandle, lrc_Rect); with szClientSize do begin Width := lrc_Rect.Right; Height := lrc_Rect.Bottom; end; //ウィンドウスタイル iStyle := GetWindowLong(hWinHandle, GWL_STYLE); //ウィンドウスタイル iStyleEx := GetWindowLong(hWinHandle, GWL_EXSTYLE); //拡張ウィンドウスタイル bEnabled := IsWindowEnabled(hWinHandle); //コントロールID iControlID := GetWindowLong(hWinHandle, GWL_ID); //PID GetWindowThreadProcessId(hWinHandle, @iProcessID); sExeName := gfnsExeNameGet(hWinHandle); sFileVersion := gfnsFileVersionGet(sExeName); end; //以下は各種情報表示 ----------------------------------------------------- //情報表示枠の塗りつぶし if (GetActiveWindow <> Self.Handle) then begin //フォームがアクティブでなければ灰色表示 FBitmapDraw.Canvas.Brush.Color := clBtnFace; FBitmapDraw.Canvas.Font.Color := clBtnText; FBitmapDraw.Canvas.Pen.Color := clBtnShadow; end else if (Action_Capture_Pause.Checked) then begin //一時停止時は薄黄色 FBitmapDraw.Canvas.Brush.Color := clInfoBk; FBitmapDraw.Canvas.Font.Color := clInfoText; FBitmapDraw.Canvas.Pen.Color := clBtnFace; end else begin FBitmapDraw.Canvas.Brush.Color := clWindow; FBitmapDraw.Canvas.Font.Color := clWindowText; FBitmapDraw.Canvas.Pen.Color := clBtnFace; end; // FSetDrawBkColor; FBitmapDraw.Canvas.FillRect(FrcInfo); //1行表示(倍率などの表示) li_Height := FrcInfo.Top + lci_LINEMARGIN; if (FsInfomation <> '') then begin //1行情報表示 FTextOut(FBitmapDraw.Canvas, FiFontHeight + lci_MARGINLEFT, li_Height, FsInfomation); end else begin FBitmapDraw.Canvas.TextOut(FiFontHeight + lci_MARGINLEFT, li_Height, Format(FGetDispFmt(G_ciFMTZOOM), [FiZoom])); if (FWriteInfo.hWinHandle <> 0) then ImageList_InfoIcon.Draw(FBitmapDraw.Canvas, FiInfoLeft + ImageList_InfoIcon.Width * lci_INFO_WRITECASH, li_Height -1, lci_INFO_WRITECASH); //テキスト書き換え用キャッシュ情報。 if (Action_Opt_StayOnTop.Checked) then ImageList_InfoIcon.Draw(FBitmapDraw.Canvas, FiInfoLeft + ImageList_InfoIcon.Width * lci_INFO_STAYONTOP, li_Height -1, lci_INFO_STAYONTOP); //常に前面に表示。 if (Action_Capture_Pause.Checked) then ImageList_InfoIcon.Draw(FBitmapDraw.Canvas, FiInfoLeft + ImageList_InfoIcon.Width * lci_INFO_PAUSE, li_Height -1, lci_INFO_PAUSE); //一時停止。 if (Action_Capture_SmoothCapture.Checked) then ImageList_InfoIcon.Draw(FBitmapDraw.Canvas, FiInfoLeft + ImageList_InfoIcon.Width * lci_INFO_SMOOTH, li_Height -1, lci_INFO_SMOOTH); //スムーズキャプチャ。 if (Action_Capture_Lupe.Checked) then ImageList_InfoIcon.Draw(FBitmapDraw.Canvas, FiInfoLeft + ImageList_InfoIcon.Width * lci_INFO_FIX, li_Height -1, lci_INFO_LUPE); //Fixと同じ場所に表示。 if (Action_Capture_Fixed.Checked) then begin ImageList_InfoIcon.Draw(FBitmapDraw.Canvas, FiInfoLeft + ImageList_InfoIcon.Width * lci_INFO_FIX, li_Height -1, lci_INFO_FIX); //Fix FBitmapDraw.Canvas.TextOut(FiInfoLeft + ImageList_InfoIcon.Width * ImageList_InfoIcon.Count, li_Height, Format(G_csMARK_FIXED, [FrDispInfo.ptMousePos.X, FrDispInfo.ptMousePos.Y])); end; end; //現在のカーソル位置の色をボックスに表示。 lcl_BackColor := FBitmapDraw.Canvas.Brush.Color; FBitmapDraw.Canvas.Brush.Color := clColorRef; FBitmapDraw.Canvas.FillRect(Rect(FrcInfo.Left +2, FrcInfo.Top +2 +1{ズーム画像との境界のライン分で+1}, FiFontHeight -2, FrcInfo.Top + FiFontHeight -2)); //枠いっぱいではなく2ピクセルづつ狭くする。 FBitmapDraw.Canvas.Brush.Color := lcl_BackColor; //枠を描画。 // FBitmapDraw.Canvas.Pen.Color := clBtnShadow; FBitmapDraw.Canvas.Pen.Color := clBlack; FBitmapDraw.Canvas.MoveTo(FrcInfo.Left +1, FrcInfo.Top +1 +1); FBitmapDraw.Canvas.LineTo(FiFontHeight -2, FrcInfo.Top +1 +1); FBitmapDraw.Canvas.LineTo(FiFontHeight -2, FrcInfo.Top + FiFontHeight -1 -1); FBitmapDraw.Canvas.LineTo(FrcInfo.Left +1, FrcInfo.Top + FiFontHeight -1 -1); FBitmapDraw.Canvas.LineTo(FrcInfo.Left +1, FrcInfo.Top +1 +1); //ウィンドウ情報を描画 FPutInfo(Sender, FrDispInfo, li_Height); //縦線 FBitmapDraw.Canvas.MoveTo(FiVLine, FrcInfo.Top + FiFontHeight +1); FBitmapDraw.Canvas.LineTo(FiVLine, ClientHeight); //画像領域と情報領域の間に線を引く FBitmapDraw.Canvas.Pen.Color := clBtnShadow; FBitmapDraw.Canvas.MoveTo(0, FrcInfo.Top); FBitmapDraw.Canvas.LineTo(ClientWidth, FrcInfo.Top); //設定画面のカーソル位置のエディットボックスの数値を合わせる if (gfnbFormExists(G_SettingCaptureForm)) //and (actCapture_Fixed.Checked) then begin G_SettingCaptureForm.SpinEdit_Capture_FixedValue := FrDispInfo.ptMousePos; end; {$IFDEF PLUGIN} if (Assigned(FPlugIn)) and (IsWindow(FPlugIn.Handle)) then begin PostMessage(FPlugIn.Handle, G_WM_APP_INFO_WINDOWHANDLE, WPARAM(iStyle), LPARAM(iStyleEx)); end; {$ENDIF} //APIテスト if (gfnbFormExists(App_BugsEyeAPITest)) and (IsWindowVisible(App_BugsEyeAPITest.Handle)) and not(App_BugsEyeAPITest.ComboBox_APIList.DroppedDown) and not(App_BugsEyeAPITest.ComboBox_TargetWindow.DroppedDown) then begin App_BugsEyeAPITest.DoApiInfo(hWinHandle, ptMousePos); DrawNow; end; end; FormPaint(nil); //拡大画像と各種情報をフォームへ描画 FiPassTime := li_TickCount; if (FiCapture_RefleshTime <> Timer_Main.Tag) then begin FSetCaptureRefleshTime(Timer_Main.Tag); end; end; FbThroughTimer := False; end; procedure TApp_BugsEye.AddList(AList: TStrings; sStr: WideString); begin if (AList = nil) then begin Exit; end; //NT系も98系もUTF-8に変換して保存 AList.Add(gfnsWideToUtf8(sStr)); end; function TApp_BugsEye.FGetZoomIndex: Integer; begin Result := gfniCheckRadioMenuIndexGet(MenuItem_Zoom); end; procedure TApp_BugsEye.FSetZoomIndex(iIndex: Integer); begin if not(gfnbIsInsideRange(iIndex, 0, MenuItem_Zoom.Count -1)) then begin Exit; end; Action_ZoomExecute(MenuItem_Zoom.Items[iIndex].Action); end; procedure TApp_BugsEye.FTextOut(ACanvas: TCanvas; iLeft, iTop: Integer; sStr: WideString); begin TextOutW(ACanvas.Handle, iLeft, iTop, PWideChar(sStr), Length(sStr)); end; function TApp_BugsEye.FPutInfo(Sender: TObject; AInfo: T_DispInfo; var iInfoTop: Integer): WideString; //FormResizeとコピーとテキスト書き換えとメインタイマーから呼び出されるルーチン const //情報表示欄に引く横ライン。 lci_LINEMARGIN = 2; var l_List : TStrings; procedure _AddInfo(Sender: TObject; iIndex: Integer; const Args: array of const; var iTop: Integer); var ls_Info : WideString; ls_Title : WideString; l_Rect : TRect; begin ls_Info := gfnsWideFormat(FGetDispFmt(iIndex), Args); // ls_Info := WideFormat(FGetDispFmt(iIndex), Args); if (Sender = Action_Copy_All) then begin AddList(l_List, ls_Info); end else begin if (Action_Opt_LineTo.Checked) then begin FBitmapDraw.Canvas.MoveTo(0, iTop - lci_LINEMARGIN); FBitmapDraw.Canvas.LineTo(ClientWidth, iTop - lci_LINEMARGIN); end; ls_Title := G_csDISPFMT[iIndex, G_ciDISP_TITLE]; TextOutW(FBitmapDraw.Canvas.Handle, G_ciTEXT_MARGIN, iTop, PWideChar(ls_Title), Length(ls_Title)); l_Rect := Rect(FiVLine +1, iTop - lci_LINEMARGIN +1, ClientWidth, iTop + FiFontHeight); FBitmapDraw.Canvas.FillRect(l_Rect); Inc(l_Rect.Left, G_ciTEXT_MARGIN); DrawTextW(FBitmapDraw.Canvas.Handle, PWideChar(ls_Info), -1, l_Rect, DT_SINGLELINE or DT_VCENTER); Inc(iTop, FiFontHeight); end; end; var ls_ColorName : String; li_Hue : WORD; li_Value : WORD; li_Saturation : WORD; li_Width : Integer; li_Height : Integer; lr_Monitor : TMyMonitorPos; begin Result := ''; Inc(iInfoTop, FiFontHeight); if not(Action_Opt_LineTo.Checked) and (Sender = Timer_Main) then begin FBitmapDraw.Canvas.MoveTo(0, iInfoTop - lci_LINEMARGIN); FBitmapDraw.Canvas.LineTo(ClientWidth, iInfoTop - lci_LINEMARGIN); end; l_List := nil; try l_List := TStringList.Create; with AInfo do begin //カラー値 //RGB if (Sender = Action_Copy_ColorRGB) or (Sender = Action_Write_ColorRGB) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_RGB], [iRed, iGreen, iBlue])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Color_RGB)) then begin _AddInfo(Sender, G_ciFMTCOLOR_RGB, [iRed, iGreen, iBlue], iInfoTop); end; //RGBの赤 if (Sender = Action_Copy_ColorRGBRed) or (Sender = Action_Write_ColorRGBRed) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_RGBRED], [iRed])); end; //RGBの緑 if (Sender = Action_Copy_ColorRGBGreen) or (Sender = Action_Write_ColorRGBGreen) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_RGBGREEN], [iGreen])); end; //RGBの青 if (Sender = Action_Copy_ColorRGBBlue) or (Sender = Action_Write_ColorRGBBlue) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_RGBBLUE], [iBlue])); end; //HTML ls_ColorName := FGetColorName(clColor); if (Sender = Action_Copy_ColorHtml) or (Sender = Action_Write_ColorHTML) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HTML], [clColor])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Color_HTML)) then begin _AddInfo(Sender, G_ciFMTCOLOR_HTML, [clColor, ls_ColorName], iInfoTop); end; //COLORREF if (Sender = Action_Copy_ColorCOLORREF) or (Sender = Action_Write_ColorCOLORREF) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_COLORREF], [clColorRef, ls_ColorName])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Color_COLORREF)) then begin _AddInfo(Sender, G_ciFMTCOLOR_COLORREF, [clColorRef, 0, ls_ColorName], iInfoTop); end; //HSV gpcColorRGBToHSV(iRed, iGreen, iBlue, li_Hue, li_Value, li_Saturation, 360, 100, 100); if (Sender = Action_Copy_ColorHSV) or (Sender = Action_Write_ColorHSV) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HSV], [li_Hue, li_Saturation, li_Value])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Color_HSV)) then begin _AddInfo(Sender, G_ciFMTCOLOR_HSV, [li_Hue, li_Saturation, li_Value], iInfoTop); end; //HSV - Hue if (Sender = Action_Copy_ColorHSVHue) or (Sender = Action_Write_ColorHSVHue) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HSVHUE], [li_Hue])); end; //HSV - Saturation if (Sender = Action_Copy_ColorHSVSaturation) or (Sender = Action_Write_ColorHSVSaturation) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HSVSATURATION], [li_Saturation])); end; //HSV - Value if (Sender = Action_Copy_ColorHSVValue) or (Sender = Action_Write_ColorHSVValue) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HSVVALUE], [li_Value])); end; //HLS gpcColorRGBToHLS(iRed, iGreen, iBlue, li_Hue, li_Value, li_Saturation, 360, 100, 100); if (Sender = Action_Copy_ColorHLS) or (Sender = Action_Write_ColorHLS) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLS], [li_Hue, li_Saturation, li_Value])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Color_HLS)) then begin _AddInfo(Sender, G_ciFMTCOLOR_HLS, [li_Hue, li_Saturation, li_Value], iInfoTop); end; //HLS - Hue if (Sender = Action_Copy_ColorHLSHue) or (Sender = Action_Write_ColorHLSHue) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSHUE], [li_Hue])); end; //HLS - Saturation if (Sender = Action_Copy_ColorHLSSaturation) or (Sender = Action_Write_ColorHLSSaturation) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSSATURATION], [li_Saturation])); end; //HLS - Lightness if (Sender = Action_Copy_ColorHLSLightness) or (Sender = Action_Write_ColorHLSLightness) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSLIGHTNESS], [li_Value])); end; //HLS Windows gpcColorRGBToHLS(iRed, iGreen, iBlue, li_Hue, li_Value, li_Saturation, 240, 240, 240); if (Sender = Action_Copy_ColorHLSWin) or (Sender = Action_Write_ColorHLSWin) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWIN], [li_Hue, li_Saturation, li_Value])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Color_HLSWin)) then begin _AddInfo(Sender, G_ciFMTCOLOR_HLSWIN, [li_Hue, li_Saturation, li_Value], iInfoTop); end; //HLSWin - Hue if (Sender = Action_Copy_ColorHLSWinHue) or (Sender = Action_Write_ColorHLSWinHue) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWINHUE], [li_Hue])); end; //HLSWin - Saturation if (Sender = Action_Copy_ColorHLSWinSaturation) or (Sender = Action_Write_ColorHLSWinSaturation) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWINSATURATION], [li_Saturation])); end; //HLSWin - Lightness if (Sender = Action_Copy_ColorHLSWinLightness) or (Sender = Action_Write_ColorHLSWinLightness) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWINLIGHTNESS], [li_Value])); end; //カーソル位置 //物理スクリーン座標 if (Sender = Action_Copy_PosScreen) or (Sender = Action_Write_PosScreen) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_SCREEN], [ptMousePos.X, ptMousePos.Y])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Pos_Screen)) then begin _AddInfo(Sender, G_ciFMTPOS_SCREEN, [ptMousePos.X, ptMousePos.Y], iInfoTop); end; //スクリーン座標 - X if (Sender = Action_Copy_PosScreenX) or (Sender = Action_Write_PosScreenX) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_SCREEN_X], [ptMousePos.X])); end; //スクリーン座標 - Y if (Sender = Action_Copy_PosScreenY) or (Sender = Action_Write_PosScreenY) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_SCREEN_Y], [ptMousePos.Y])); end; //モニター座標 lr_Monitor := gfnrScreenToMonitor(MyScreenSize, ptMousePos); if (Sender = Action_Copy_PosMonitor) or (Sender = Action_Write_PosMonitor) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_MONITOR], [lr_Monitor.Position.X, lr_Monitor.Position.Y])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Pos_Monitor)) then begin _AddInfo(Sender, G_ciFMTPOS_MONITOR, [lr_Monitor.Position.X, lr_Monitor.Position.Y, lr_Monitor.MonitorNum], iInfoTop); end; //モニター座標 - X if (Sender = Action_Copy_PosMonitorX) or (Sender = Action_Write_PosMonitorX) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_MONITOR_X], [lr_Monitor.Position.X])); end; //モニター座標 - Y if (Sender = Action_Copy_PosMonitorY) or (Sender = Action_Write_PosMonitorY) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_MONITOR_Y], [lr_Monitor.Position.Y])); end; //クライアント座標 if (Sender = Action_Copy_PosClient) or (Sender = Action_Write_PosClient) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_CLIENT], [ptMousePos.X - ptClientPos.X, ptMousePos.Y - ptClientPos.Y])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_Pos_Client)) then begin _AddInfo(Sender, G_ciFMTPOS_CLIENT, [ptMousePos.X - ptClientPos.X, ptMousePos.Y - ptClientPos.Y, ptClientPos.X, ptClientPos.Y], iInfoTop); end; //クライアント座標 - X if (Sender = Action_Copy_PosClientX) or (Sender = Action_Write_PosClientX) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_CLIENT_X], [ptMousePos.X - ptClientPos.X])); end; //クライアント座標 - Y if (Sender = Action_Copy_PosClientY) or (Sender = Action_Write_PosClientY) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_CLIENT_Y], [ptMousePos.Y - ptClientPos.Y])); end; //長さ li_Width := Abs(ptMousePos.X - ptLengthPos.X) +1; //座標ではなく長さなので+1 li_Height := Abs(ptMousePos.Y - ptLengthPos.Y) +1; if (Sender = Action_Copy_PosLength) or (Sender = Action_Write_PosLength) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_LENGTH], [li_Width, li_Height, ptLengthPos.X, ptLengthPos.Y])); end else if (Sender = Action_Copy_All) or (Action_Pos_Length.Checked) then begin _AddInfo(Sender, G_ciFMTPOS_LENGTH, [li_Width, li_Height, ptLengthPos.X, ptLengthPos.Y], iInfoTop); end; //長さ - 幅 if (Sender = Action_Copy_PosLengthWidth) or (Sender = Action_Write_PosLengthWidth) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_LENGTH_WIDTH], [li_Width])); end; //長さ - 幅 if (Sender = Action_Copy_PosLengthHeight) or (Sender = Action_Write_PosLengthHeight) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTPOS_LENGTH_HEIGHT], [li_Height])); end; //ウィンドウ情報 //ハンドル if (Sender = Action_Copy_WinInfoHandle) or (Sender = Action_Write_WinInfoHandle) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_HANDLE], [hWinHandle])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_Handle)) then begin _AddInfo(Sender, G_ciFMTWININFO_HANDLE, [hWinHandle], iInfoTop); end; //クラス名 if (Sender = Action_Copy_WinInfoClassName) or (Sender = Action_Write_WinInfoClassName) then begin AddList(l_List, gfnsWideFormat(CopyFmt[G_ciFMTWININFO_CLASSNAME], [sWinClass])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_ClassName)) then begin _AddInfo(Sender, G_ciFMTWININFO_CLASSNAME, [sWinClass], iInfoTop); end; //テキスト if (Sender = Action_Copy_WinInfoText) or (Sender = Action_Write_WinInfoText) then begin AddList(l_List, gfnsWideFormat(CopyFmt[G_ciFMTWININFO_TEXT], [sWinText])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_Text)) then begin _AddInfo(Sender, G_ciFMTWININFO_TEXT, [sWinText], iInfoTop); end; //ウィンドウサイズ if (Sender = Action_Copy_WinInfoWindowSize) or (Sender = Action_Write_WinInfoWindowSize) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE], [szWindowSize.Left, szWindowSize.Top, szWindowSize.Width, szWindowSize.Height, '', ''])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_WindowSize)) then begin _AddInfo(Sender, G_ciFMTWININFO_WINDOWSIZE, [szWindowSize.Width, szWindowSize.Height, szWindowSize.Left, szWindowSize.Top], iInfoTop); end; //ウィンドウサイズ - Left if (Sender = Action_Copy_WinInfoWindowSizeLeft) or (Sender = Action_Write_WinInfoWindowSizeLeft) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_LEFT], [szWindowSize.Left])); end; //ウィンドウサイズ - Top if (Sender = Action_Copy_WinInfoWindowSizeTop) or (Sender = Action_Write_WinInfoWindowSizeTop) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_TOP], [szWindowSize.Top])); end; //ウィンドウサイズ - Width if (Sender = Action_Copy_WinInfoWindowSizeWidth) or (Sender = Action_Write_WinInfoWindowSizeWidth) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_WIDTH], [szWindowSize.Width])); end; //ウィンドウサイズ - Height if (Sender = Action_Copy_WinInfoWindowSizeHeight) or (Sender = Action_Write_WinInfoWindowSizeHeight) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_HEIGHT], [szWindowSize.Height])); end; //クライアントサイズ if (Sender = Action_Copy_WinInfoClientSize) or (Sender = Action_Write_WinInfoClientSize) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_CLIENTSIZE], [szClientSize.Width, szClientSize.Height])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_ClientSize)) then begin _AddInfo(Sender, G_ciFMTWININFO_CLIENTSIZE, [szClientSize.Width, szClientSize.Height], iInfoTop); end; //クライアントサイズ - Width if (Sender = Action_Copy_WinInfoClientSizeWidth) or (Sender = Action_Write_WinInfoClientSizeWidth) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_CLIENTSIZE_WIDTH], [szClientSize.Width])); end; //クライアントサイズ - Height if (Sender = Action_Copy_WinInfoClientSizeHeight) or (Sender = Action_Write_WinInfoClientSizeHeight) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_CLIENTSIZE_HEIGHT], [szClientSize.Height])); end; //RECT if (Sender = Action_Copy_WinInfoRect) or (Sender = Action_Write_WinInfoRect) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_RECT], [rcWinRect.Left, rcWinRect.Top, rcWinRect.Right, rcWinRect.Bottom])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_Rect)) then begin _AddInfo(Sender, G_ciFMTWININFO_RECT, [rcWinRect.Left, rcWinRect.Top, rcWinRect.Right, rcWinRect.Bottom], iInfoTop); end; //RECT - Left if (Sender = Action_Copy_WinInfoRectLeft) or (Sender = Action_Write_WinInfoRectLeft) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_LEFT], [rcWinRect.Left])); end; //RECT - Top if (Sender = Action_Copy_WinInfoRectTop) or (Sender = Action_Write_WinInfoRectTop) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_TOP], [rcWinRect.Top])); end; //RECT - Right if (Sender = Action_Copy_WinInfoRectRight) or (Sender = Action_Write_WinInfoRectRight) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_RIGHT], [rcWinRect.Right])); end; //RECT - Bottom if (Sender = Action_Copy_WinInfoRectBottom) or (Sender = Action_Write_WinInfoRectBottom) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_BOTTOM], [rcWinRect.Bottom])); end; //コントロールID if (Sender = Action_Copy_WinInfoControlID) or (Sender = Action_Write_WinInfoControlID) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_CONTROLID], [iControlID])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_ControlID)) then begin _AddInfo(Sender, G_ciFMTWININFO_CONTROLID, [iControlID], iInfoTop); end; //ウィンドウスタイル if (Sender = Action_Copy_WinInfoStyle) or (Sender = Action_Write_WinInfoStyle) then begin //ウィンドウスタイル AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_STYLE], [iStyle])); end else if (Sender = Action_Copy_WinInfoStyleEx) or (Sender = Action_Write_WinInfoStyleEx) then begin //拡張ウィンドウスタイル AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_STYLEEX], [iStyleEx])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_Style)) then begin //スタイル _AddInfo(Sender, G_ciFMTWININFO_STYLE, [iStyle], iInfoTop); //拡張スタイル _AddInfo(Sender, G_ciFMTWININFO_STYLEEX, [iStyleEx], iInfoTop); end; //ウィンドウが有効かどうか。 //単独のコピー、テキスト書き換えメニューは無し。 if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_Enabled)) then begin _AddInfo(Sender, G_ciFMTWININFO_ENABLED, [gfnsBoolToStr(bEnabled)], iInfoTop); end; //親ウィンドウのハンドル。 //単独のコピー、テキスト書き換えメニューは無し。 if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_ParentWindow)) then begin _AddInfo(Sender, G_ciFMTWININFO_PARENTWINDOW, [hParentHandle, sParentClassName, sParentText], iInfoTop); end; //プロセスID。 if (Sender = Action_Copy_WinInfoPID) or (Sender = Action_Write_WinInfoPID) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_PID], [iProcessID])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_PID)) then begin _AddInfo(Sender, G_ciFMTWININFO_PID, [iProcessID], iInfoTop); end; //実行ファイル名 if (Sender = Action_Copy_WinInfoExeName) or (Sender = Action_Write_WinInfoExeName) then begin AddList(l_List, gfnsWideFormat(CopyFmt[G_ciFMTWININFO_EXENAME], [sExeName, gfnsFileNameGet(sExeName)])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_ExeName)) then begin _AddInfo(Sender, G_ciFMTWININFO_EXENAME, [sExeName], iInfoTop); end; //ファイルバージョン if (Sender = Action_Copy_WinInfoFileVersion) or (Sender = Action_Write_WinInfoFileVersion) then begin AddList(l_List, WideFormat(CopyFmt[G_ciFMTWININFO_FILEVERSION], [sFileVersion])); end else if (Sender = Action_Copy_All) or (FIsActionEnabled(MenuItem_WinInfo_FileVersion)) then begin _AddInfo(Sender, G_ciFMTWININFO_FILEVERSION, [sFileVersion], iInfoTop); end; {$IFNDEF PLUGIN} //ウィンドウスタイル詳細 // if (Sender = Action_Copy_WinInfoStyleVerbose) // or (Sender = Action_Copy_All) // or (gfnbFormExists(App_BugsEyeWindowStyle) and (Sender = App_BugsEyeWindowStyle.actWindowStyleText_Open)) if (gfnbFormExists(App_BugsEyeWindowStyle)) and ((Sender = App_BugsEyeWindowStyle.Action_WindowStyle_TextOpen) or (Sender = App_BugsEyeWindowStyle.Action_WindowStyle_TextCopy)) then begin // if (Sender = Action_Copy_All) // then begin // AddList(l_List, ''); //空行を挿入 // end; AddList(l_List, 'ウィンドウスタイル詳細'); App_BugsEyeWindowStyle.DrawStyle(l_List, hWinHandle, sWinClass, sWinText, iStyle, iStyleEx); end else if (FIsActionEnabled(MenuItem_WinInfo_StyleVerbose)) then begin if not(gfnbFormExists(App_BugsEyeWindowStyle)) then begin App_BugsEyeWindowStyle := TApp_BugsEyeWindowStyle.Create(Self); end; App_BugsEyeWindowStyle.DrawStyle(nil, hWinHandle, sWinClass, sWinText, iStyle, iStyleEx); end; {$ENDIF} end; //テキスト書き換えで利用する Result := gfnsUtf8ToWide(TrimRight(l_List.Text)); if ((Sender is TAction) and (TAction(Sender).Category = Action_Copy_All.Category)) // or (gfnbFormExists(App_BugsEyeWindowStyle) and (Sender = App_BugsEyeWindowStyle.actWindowStyleText_Open)) then begin //ここでクリップボードへコピー //引数はUTF8 gpcStrToClipboard(Result); //インフォメーション欄に出力 FPushInfomation(gfnsWideFormat(G_csFMT_COPY, [TAction(Sender).Caption, Result])); end; finally l_List.Free; end; end; //============================================================================== procedure TApp_BugsEye.ApplicationEvents1Activate(Sender: TObject); begin DrawNow; end; procedure TApp_BugsEye.ApplicationEvents1Deactivate(Sender: TObject); begin FCapture_KeyUp; DrawNow; end; //コピー ----------------------------------------------------------------------- { function TApp_BugsEye.FGetFileName(sExt: WideString): WideString; begin Result := gfnsFileExtChange(gfnsExeNameGet, sExt); end; } //クリップボードへ画像をコピー procedure TApp_BugsEye.Action_Copy_PictureExecute(Sender: TObject); var l_Bitmap: TMyBitmap; ls_Caption: String; { lb_Timer: Boolean; li_Rop: DWORD; ldc_Desktop: HDC; ls_File: WideString; li_ErrMode: UINT; } begin if (gfnbKeyState(VK_SHIFT)) then begin Action_Custom_CopyExecute(Sender); Exit; end; l_Bitmap := TMyBitmap.Create; try l_Bitmap.Width := Self.ClientWidth; if (FGetCopyZoomInfo) then begin //情報欄もコピー l_Bitmap.Height := Self.ClientHeight - FGetToolBarHeight; //ツールバーは除外 end else begin //画像だけコピー l_Bitmap.Height := Self.ClientHeight - FGetToolBarHeight - gfniRectHeight(FrcInfo); end; Windows.BitBlt(l_Bitmap.Canvas.Handle, 0, 0, l_Bitmap.Width, l_Bitmap.Height, FBitmapDraw.Canvas.Handle, 0, 0, SRCCOPY); ls_Caption := G_csMARK_PICTURE; Clipboard.Assign(l_Bitmap); finally l_Bitmap.Free; end; FPushInfomation(Format(G_csFMT_COPY, [ls_Caption, ''])); end; //クリップボードへテキストをコピー procedure TApp_BugsEye.Action_Copy_TextExecute(Sender: TObject); var lb_TimerEnabled: Boolean; li_Dummy: Longint; begin //Shiftキーが押されていればフォーマット形式の編集フォームを開く if (gfnbKeyState(VK_SHIFT)) then begin Action_Custom_CopyExecute(Sender); Exit; end; lb_TimerEnabled := Timer_Main.Enabled; Timer_Main.Enabled := False; li_Dummy := 0; FPutInfo(Sender, FrDispInfo, li_Dummy); Timer_Main.Enabled := lb_TimerEnabled; end; procedure TApp_BugsEye.Action_Copy_AllExecute(Sender: TObject); //すべてのテキスト情報をクリップボードへコピー begin //Action_Copy_PictureExecute(nil); Action_Copy_TextExecute(Action_Copy_All); end; (* //マウスの左ボタンでフォームをつかんで移動できるようにする procedure TApp_BugsEye.WMLButtonDown(var Msg: TWMLButtonDown); begin //そのままでは左ボタンのイベントがうまく処理できないのでOnMouseDownではなくここでやる F_ptMvClientMousePos := gfnptClientMousePosGet(Handle); if (actCapture_Pause.Checked or actCapture_Fixed.Checked) // and (gfnbKeyState(VK_SHIFT)) and not(PtInRect(gfnrcRectShift(FrcInfo, Point(0, F_GetToolHieht)), F_ptMvClientMousePos)) then begin //ポイント移動開始 SetCaptureControl(Self); F_bIsMoving := True; F_ptMvMousePos := F_rInfo.ptMousePos; end else if (gfnbKeyState(VK_CONTROL)) then begin //何もしないがMouseUpメッセージを得るために↓の処理には入らない end else if not(Windows.IsZoomed(Handle)) then begin //最大化しても移動できてしまったのでそれへの対処 SendMessage(Handle, WM_SYSCOMMAND, WPARAM(SC_MOVE or 8), 0); F_pcDrawStart; end; end; *) //マウスジェスチャー procedure TApp_BugsEye.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if (Button = mbRight) then begin FptGesture := Point(X, Y); end else if (Button = mbLeft) then begin FbInfoDrag := PtInRect(FrcInfoDrag, Point(X, Y)); if (FbInfoDrag) then begin Exit; end; FptDragClientPos := gfnptClientMousePosGet(Self.Handle); FptDragPos := gfnptPhysicalCursorPosGet; if (Action_Capture_Pause.Checked or Action_Capture_Fixed.Checked) and not(PtInRect(gfnrcRectShift(FrcInfo, Point(0, FGetToolBarHeight)), FptDragClientPos)) //ツールバーをつかんでいない and not(Action_Capture_Lupe.Checked and Action_Capture_Lupe.Enabled) //ルーペモードではない then begin //ポイント移動開始 SetCaptureControl(Self); FbDragMove := True; FptDragScreenPos := FrDispInfo.ptMousePos; end else if (gfnbKeyState(VK_CONTROL)) then begin //何もしないがMouseUpメッセージを得るために↓の処理には入らない end else if not(Windows.IsZoomed(Handle)) then begin //最大化しても移動できてしまったのでそれへの対処 //つかんで移動 ReleaseCapture; SendMessage(Self.Handle, WM_SYSCOMMAND, WPARAM(SC_MOVE or 8), 0); DrawNow; end; end; end; procedure TApp_BugsEye.FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var lpt_Pos : TPoint; lpt_DragPos : TPoint; lr_Monitor : TMyMonitorPos; begin if (FbDragMove) and (ssLeft in Shift) then begin FbDragMove := False; //処理しきれないイベントを捨てるためのフラグでもある lpt_DragPos := gfnptPhysicalCursorPosGet; case FrDispInfo.fpCapture_ZoomFlip of fpFlipHorizontal :begin lpt_DragPos.X := FptDragPos.X - (lpt_DragPos.X - FptDragPos.X); end; fpFlipVertical :begin lpt_DragPos.Y := FptDragPos.Y - (lpt_DragPos.Y - FptDragPos.Y); end; fpFlipBoth, fpRotate180 :begin lpt_DragPos.X := FptDragPos.X - (lpt_DragPos.X - FptDragPos.X); lpt_DragPos.Y := FptDragPos.Y - (lpt_DragPos.Y - FptDragPos.Y); end; fpRotate90 :begin lpt_DragPos.X := FptDragPos.X - (lpt_DragPos.X - FptDragPos.X); lpt_DragPos.Y := FptDragPos.Y - (lpt_DragPos.Y - FptDragPos.Y); end; fpRotate270 :begin end; end; //myDebug.gpcDebug([FptDragClientPos.X, FptDragClientPos.Y, ' - ', lpt_DragPos.X, lpt_DragPos.Y]); lpt_Pos := Point( //高DPI対応 gfniNumLimit(gfniRound((FptDragScreenPos.X * FiZoom + FptDragPos.X - lpt_DragPos.X) / FiZoom), MyScreenSize.ScreenLeft, MyScreenSize.DesktopRect.Right -1), gfniNumLimit(gfniRound((FptDragScreenPos.Y * FiZoom + FptDragPos.Y - lpt_DragPos.Y) / FiZoom), MyScreenSize.ScreenTop, MyScreenSize.DesktopRect.Bottom -1) ); FrDispInfo.ptMousePos := lpt_Pos; lr_Monitor := gfnrScreenToMonitor(MyScreenSize, lpt_Pos); if (lr_Monitor.MonitorNum = 0) and (FiMonitorNum > 0) //AIU then begin FrDispInfo.ptMousePos.X := gfniNumLimit(FrDispInfo.ptMousePos.X, MyScreenSize.MonitorsRect[FiMonitorNum -1].Left, MyScreenSize.MonitorsRect[FiMonitorNum -1].Right -1); FrDispInfo.ptMousePos.Y := gfniNumLimit(FrDispInfo.ptMousePos.Y, MyScreenSize.MonitorsRect[FiMonitorNum -1].Top, MyScreenSize.MonitorsRect[FiMonitorNum -1].Bottom -1); end else begin FiMonitorNum := lr_Monitor.MonitorNum; end; if (Action_Capture_Fixed.Checked) then begin Timer_InfomationTimer(nil); //定点キャプチャの原点表示を更新 end; DrawNow; Application.ProcessMessages; //余計なキューを捨てる FbDragMove := True; //元に戻す end else if not(FbInfoDrag) then begin if (PtInRect(FrcInfoDrag, Point(X, Y))) then begin Self.Cursor := crHSplit; end else begin Self.Cursor := crDefault; end; end; end; //マウスアップ procedure TApp_BugsEye.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); const lci_Limit = 8; var lpt_Pos : TPoint; ls_Compas : WideString; l_Action : TAction; begin if (Button = mbLeft) then begin ReleaseCapture; FbDragMove := False; if (FbInfoDrag) then begin FiVLine := gfniNumLimit(X, lci_Limit, Self.ClientWidth - lci_Limit); FSetInfoDrag; FbInfoDrag := False; Self.Cursor := crDefault; DrawNow; end else begin if (Action_Capture_Pause.Checked or Action_Capture_Fixed.Checked) and (ssCtrl in Shift) and not(ssShift in Shift) then begin //[Ctrl]キーが押されていて[Shift]キーが押されていなければカーソル位置にキャプチャポイントをもっていく FormDblClick(nil); end; end; end else if (Button = mbRight) and ((FptGesture.X > 0) and (FptGesture.Y > 0)) then begin //マウスジェスチャー ls_Compas := gfnsCompasGet(FptGesture, Point(X, Y)); if (ls_Compas = '') then begin //いわゆる右クリック //ポップアップメニュー lpt_Pos := ClientToScreen(Point(X, Y)); PopupMenu_Main.Popup(lpt_Pos.X, lpt_Pos.Y); end else begin if (ls_Compas = 'Up') then begin l_Action := G_GestureUp; end else if (ls_Compas = 'Down') then begin l_Action := G_GestureDown; end else if (ls_Compas = 'Left') then begin l_Action := G_GestureLeft; end else if (ls_Compas = 'Right') then begin l_Action := G_GestureRight end else begin l_Action := nil; end; if (l_Action <> nil) then begin if (l_Action.AutoCheck) then begin l_Action.Checked := not(l_Action.Checked); end; l_Action.OnExecute(l_Action); end; end; end; end; //------------------------------------------------------------------------------ //カスタマイズ procedure TApp_BugsEye.Action_Custom_SettingExecute(Sender: TObject); //一覧設定 begin if not(gfnbFormExists(Form_Setting)) then begin Action_Custom_Setting.Enabled := False; G_pcCreateSettingForm; // G_SettingForm.SetPage('オプション'); Action_Custom_Setting.Enabled := True; end; G_pcSetTabSheet(G_CustomForm.TabSheet_Option); end; procedure TApp_BugsEye.Action_Custom_MenuExecute(Sender: TObject); //メニュー begin G_pcCreateMenuForm; G_pcSetTabSheet(G_CustomForm.tabMenu); end; procedure TApp_BugsEye.Action_Custom_ToolBarExecute(Sender: TObject); //ツールバー begin G_pcCreateToolBarForm; G_pcSetTabSheet(G_CustomForm.tabToolBar); end; procedure TApp_BugsEye.Action_Custom_ShortCutExecute(Sender: TObject); //ショートカット begin G_pcCreateShortCutForm; G_pcSetTabSheet(G_CustomForm.tabShortCut); end; procedure TApp_BugsEye.Action_Custom_CopyExecute(Sender: TObject); //コピーフォーマット var i: Integer; l_Action: TAction; begin G_pcCreateCopyForm; with Form_Custom_Copy do begin if (Sender is TAction) and (Pos('Action_Copy_', TAction(Sender).Name) = 1) then begin //コピー形式 l_Action := TAction(Sender); for i := 0 to ComboBox_Copy_FmtSel.Items.Count -1 do begin if (ComboBox_Copy_FmtSel.Items[i] = l_Action.Caption) then begin ComboBox_Copy_FmtSel.ItemIndex := i; ComboBox_Copy_FmtSelSelect(Sender); end; end; end; end; G_pcSetTabSheet(G_CustomForm.tabCopy); end; //--- ツールバー --------------------------------------------------------------- //パネルをつかんでフォームを移動 procedure TApp_BugsEye.Panel_ToolBarMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin //http://delfusa.main.jp/delfusafloor/archive/VA009712_take/delphi/kabedel.htm if (Button = mbLeft) then begin ReleaseCapture; SendMessage(Handle, WM_SYSCOMMAND, WPARAM(SC_SIZE or 9), 0); end else if (Button = mbRight) then begin FptGesture := Point(X, Y); end; end; procedure TApp_BugsEye.actNop(Sender: TObject); begin //ダミー end; //モニター間移動 procedure TApp_BugsEye.Action_Move_MonitorExecute(Sender: TObject); var lrc_Rect : TRect; li_Index : Integer; begin if (gfnbKeyState(VK_SHIFT)) then begin //モニター間移動。 li_Index := gfniNumLoop(MyScreenSize.MonitorNum(Self) +1, 1, MyScreenSize.MonitorCount) -1; lrc_Rect := MyScreenSize.MonitorsRect[li_Index]; SetBounds(lrc_Rect.Left, lrc_Rect.Top, Width, Height); end else begin //プライマリモニターの左上に移動。 SetBounds(0, 0, Width, Height); end; end; //カーソル移動 procedure TApp_BugsEye.Action_Move_LeftExecute(Sender: TObject); procedure _CaptureMove(X, Y: Integer); var lr_Monitor : TMyMonitorPos; begin if ((Action_Capture_Fixed.Checked) or (Action_Capture_Pause.Checked)) then begin FrDispInfo.ptMousePos := Point( gfniNumLimit(FrDispInfo.ptMousePos.X + X, MyScreenSize.ScreenLeft, MyScreenSize.DesktopRect.Right -1), gfniNumLimit(FrDispInfo.ptMousePos.Y + Y, MyScreenSize.ScreenTop, MyScreenSize.DesktopRect.Bottom -1) ); lr_Monitor := gfnrScreenToMonitor(MyScreenSize, FrDispInfo.ptMousePos); if (lr_Monitor.MonitorNum = 0) and (FiMonitorNum > 0) //AIU then begin FrDispInfo.ptMousePos.X := gfniNumLimit(FrDispInfo.ptMousePos.X, MyScreenSize.MonitorsRect[FiMonitorNum -1].Left, MyScreenSize.MonitorsRect[FiMonitorNum -1].Right -1); FrDispInfo.ptMousePos.Y := gfniNumLimit(FrDispInfo.ptMousePos.Y, MyScreenSize.MonitorsRect[FiMonitorNum -1].Top, MyScreenSize.MonitorsRect[FiMonitorNum -1].Bottom -1); end else begin FiMonitorNum := lr_Monitor.MonitorNum; end; Timer_InfomationTimer(nil); DrawNow; end; end; procedure _SetBounds(iLeft, iTop : Integer); begin iLeft := gfniNumLimit(iLeft, MyScreenSize.ScreenLeft, MyScreenSize.DesktopRect.Right - Self.Width); iTop := gfniNumLimit(iTop, MyScreenSize.ScreenTop, MyScreenSize.DesktopRect.Bottom - Self.Height + gfniRectHeight(FrcInfo)); SetBounds(iLeft, iTop, Width, Height); end; var li_Move : Integer; begin if (gfnbFormExists(G_SettingCaptureForm)) then begin G_SettingCaptureForm.Tag := 0; end; if (gfnbKeyState(VK_SHIFT)) then li_Move := 10 else li_Move := 1; if (Sender = Action_Move_Left) then begin if (Action_Capture_Lupe.Checked and Action_Capture_Lupe.Enabled) then begin _SetBounds(Left - li_Move, Top); end else if (Action_Capture_Pause.Checked or Action_Capture_Fixed.Checked) then begin _CaptureMove(-li_Move, 0); end else begin //カーソル移動← SetCursorPos(FrDispInfo.ptMousePos.X -li_Move, FrDispInfo.ptMousePos.Y); mouse_event(MOUSEEVENTF_MOVE, DWORD(-li_Move), 0, 0, 0); end; end else if (Sender = Action_Move_Right) then begin if (Action_Capture_Lupe.Checked and Action_Capture_Lupe.Enabled) then begin _SetBounds(Left + li_Move, Top); end else if (Action_Capture_Pause.Checked or Action_Capture_Fixed.Checked) then begin _CaptureMove(li_Move, 0); end else begin //カーソル移動→ SetCursorPos(FrDispInfo.ptMousePos.X +li_Move, FrDispInfo.ptMousePos.Y); // mouse_event(MOUSEEVENTF_MOVE, li_Move, 0, 0, 0); end; end else if (Sender = Action_Move_Up) then begin if (Action_Capture_Lupe.Checked and Action_Capture_Lupe.Enabled) then begin _SetBounds(Left, Top - li_Move); end else if (Action_Capture_Pause.Checked or Action_Capture_Fixed.Checked) then begin _CaptureMove(0, -li_Move); end else begin //カーソル移動↑ SetCursorPos(FrDispInfo.ptMousePos.X, FrDispInfo.ptMousePos.Y -li_Move); // mouse_event(MOUSEEVENTF_MOVE, 0, DWORD(-li_Move), 0, 0); end; end else if (Sender = Action_Move_Down) then begin if (Action_Capture_Lupe.Checked and Action_Capture_Lupe.Enabled) then begin _SetBounds(Left, Top + li_Move); end else if (Action_Capture_Pause.Checked or Action_Capture_Fixed.Checked) then begin _CaptureMove(0, li_Move); end else begin //カーソル移動↓ SetCursorPos(FrDispInfo.ptMousePos.X, FrDispInfo.ptMousePos.Y +li_Move); // mouse_event(MOUSEEVENTF_MOVE, 0, li_Move, 0, 0); end; end; if (gfnbFormExists(G_SettingCaptureForm)) then begin G_SettingCaptureForm.Tag := 1; end; end; procedure TApp_BugsEye.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean); begin if (Msg.CharCode = VK_MENU) then begin //[Alt]を殺す Handled := True; end; end; procedure TApp_BugsEye.WMSysCommand(var Msg: TWMSysCommand); begin //myDebug.gpcDebugAdd('WMSysCommand', Msg.CmdType); case Msg.CmdType of SC_MAXIMIZE: begin end; 61490: begin //タイトルバーのダブルクリック end; { 61458: begin //タイトルバーマウスダウン inherited; end; } 61587: begin Action_Menu_MainExecute(Action_Menu_Main); end; else begin inherited; end; end; end; procedure TApp_BugsEye.WMMove(var Msg: TWMMove); begin Msg.Result := 1; //この判定がないとCPUが非力なPCで多分固まる if (FbWMMove) then begin Exit; end; FbWMMove := True; if (Action_Capture_Lupe.Checked and Action_Capture_Lupe.Enabled) // and (F_ptMove_x1.X = -3200) //これと // and (F_ptMove_x1.Y = -3200) //この判定は必須。ないとルーペモードで固まる //と思ったが色々やった結果これがあると途中経過を表示しない不具合につながるのでコメントアウト then begin DrawNow; Msg.Result := 0; end; FbWMMove := False; end; //------------------------------------------------------------------------------ //メニュー procedure TApp_BugsEye.Action_Menu_MainExecute(Sender: TObject); //メニューのポップアップ var l_Action : TAction; l_PopupMenu : TPopupMenu; begin if not(Sender is TAction) then begin Exit; end; l_Action := TAction(Sender); l_PopupMenu := TPopupMenu(FindComponent(Format('PopupMenu_%s', [Copy(l_Action.Name, Length('Action_Menu_') +1, MAXINT)]))); if (l_PopupMenu = nil) then begin Exit; end; l_PopupMenu.Popup(Self.ClientOrigin.X, Self.ClientOrigin.Y); end; //------------------------------------------------------------------------------ //一括On/Off procedure TApp_BugsEye.Action_Color_InfoOnOffExecute(Sender: TObject); begin Action_Color_RGB.Checked := not( (Action_Color_RGB.Checked) and (Action_Color_HTML.Checked) and (Action_Color_COLORREF.Checked) and (Action_Color_HSV.Checked) and (Action_Color_HLS.Checked) and (Action_Color_HLSWin.Checked) ); Action_Color_HTML.Checked := Action_Color_RGB.Checked; Action_Color_COLORREF.Checked := Action_Color_RGB.Checked; Action_Color_HSV.Checked := Action_Color_RGB.Checked; Action_Color_HLS.Checked := Action_Color_RGB.Checked; Action_Color_HLSWin.Checked := Action_Color_RGB.Checked; FormResize(nil) end; procedure TApp_BugsEye.Action_Pos_InfoOnOffExecute(Sender: TObject); begin Action_Pos_Screen.Checked := not( (Action_Pos_Screen.Checked) and (Action_Pos_Monitor.Checked) and (Action_Pos_Client.Checked) and (Action_Pos_Length.Checked) ); Action_Pos_Monitor.Checked := Action_Pos_Screen.Checked; Action_Pos_Client.Checked := Action_Pos_Screen.Checked; Action_Pos_Length.Checked := Action_Pos_Screen.Checked; FormResize(nil) end; procedure TApp_BugsEye.Action_WinInfo_InfoOnOffExecute(Sender: TObject); begin Action_WinInfo_Handle.Checked := not( (Action_WinInfo_Handle.Checked) and (Action_WinInfo_ClassName.Checked) and (Action_WinInfo_Text.Checked) and (Action_WinInfo_WindowSize.Checked) and (Action_WinInfo_ClientSize.Checked) and (Action_WinInfo_Rect.Checked) and (Action_WinInfo_ControlID.Checked) and (Action_WinInfo_Style.Checked) // and (Action_WinInfo_StyleVerbose.Checked) and (Action_WinInfo_ParentWindow.Checked) and (Action_WinInfo_PID.Checked) and (Action_WinInfo_ExeName.Checked) and (Action_WinInfo_FileVersion.Checked) ); Action_WinInfo_ClassName.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_Text.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_WindowSize.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_ClientSize.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_Rect.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_ControlID.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_Style.Checked := Action_WinInfo_Handle.Checked; // Action_WinInfo_StyleVerbose.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_ParentWindow.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_PID.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_ExeName.Checked := Action_WinInfo_Handle.Checked; Action_WinInfo_FileVersion.Checked := Action_WinInfo_Handle.Checked; //スタイル詳細の表示を取りやめたので必要ない // Action_WinInfo_StyleExecute(nil); //この中でFormResizeを呼んでいる FormResize(nil); end; //============================================================================== (* const lcsSECT_BOUNDS = 'Bounds'; lcsSECT_ZOOM = 'Zoom'; lcsKEY_ZOOMINDEX = 'ZoomIndex'; lcsSECT_GRID = 'Grid'; lcsKEY_GRIDDISP = 'View'; lcsKEY_GRIDGRIDINDEX = 'GridIndex'; lcsKEY_GRIDSUBGRIDINDEX = 'SubGridIndex'; lcsKEY_GRIDCOLOR = 'Color'; //グリッド色選択で選択した色 lcsKEY_GRIDSUBCOLOR = 'SubColor'; //サブグリッド色選択で選択した色 lcsKEY_GRIDSUBELSECOLOR = 'SubElseColor'; lcsKEY_GRIDUSEELSECOLOR = 'UseSubElseColor'; //サブグリッドに二色使うか lcsSECT_POS = 'Position'; lcsKEY_POSSCREEN = 'Screen'; lcsKEY_POSMONITOR = 'Monitor'; lcsKEY_POSCLIENT = 'Client'; lcsKEY_POSUSER = 'User'; lcsKEY_POSUSERPOS = 'UserPos'; lcsSECT_COLOR = 'ColorInfo'; lcsKEY_COLORRGB = 'RGB'; lcsKEY_COLORHTML = 'HTML'; lcsKEY_COLORCOLORREF = 'COLORREF'; lcsKEY_COLORHSV = 'HSV'; lcsKEY_COLORHLS = 'HLS'; lcsKEY_COLORHLSWIN = 'HLSWindows'; lcsSECT_WININFO = 'WindowInfo'; lcsKEY_WINHANDLE = 'Handle'; lcsKEY_WINCLASSNAME = 'ClassName'; lcsKEY_WINTEXT = 'Text'; lcsKEY_WINWINDOWSIZE = 'WindowSize'; lcsKEY_WINCLIENTSIZE = 'ClientSize'; lcsKEY_WINRECT = 'Rect'; lcsKEY_WINCONTROLID = 'ControlID'; lcsKEY_WINSTYLE = 'Style'; lcsKEY_WINSTYLEVERBOSE = 'StyleVerbose'; lcsKEY_WINPARENTWINDOW = 'ParentWindow'; lcsKEY_WINPID = 'ProcessID'; lcsKEY_WINEXENAME = 'ExeName'; lcsKEY_WINFILEVERSION = 'FileVersion'; lcsSECT_WINSTYLE = 'WindowStyle'; lcsKEY_WINSTYLEBUTTON = 'Button'; lcsKEY_WINSTYLECOMBOBOX = 'ComboBox'; lcsKEY_WINSTYLEEDIT = 'Edit'; lcsKEY_WINSTYLELISTBOX = 'ListBox'; lcsKEY_WINSTYLEDIALOG = 'Dialog'; lcsKEY_WINSTYLESCROLLBAR = 'ScrollBar'; lcsKEY_WINSTYLESTATIC = 'Static'; lcsKEY_WINSTYLEFOLLOW = 'MoveFollow'; lcsSECT_OPT = 'Option'; lcsKEY_OPTSTAYONTOP = 'StayOnTop'; lcsKEY_OPTTOOLBAR = 'ToolBar'; lcsKEY_OPTBIGFONT = 'BigFont'; lcsKEY_OPTNOSELFCAPTURE = 'NoSelfCapture'; lcsKEY_CAPTURELUPEMODE = 'LupeMode'; lcsKEY_OPTUNICODE = 'Unicode'; lcsSECT_COPY = 'Copy'; lcsKEY_COPYITEM = 'Item'; //設定データの読み込み procedure TApp_BugsEye.F_LoadIni; var l_IniFile: TMyIniFile; li_Index: Integer; lsl_List: TStrings; i: Integer; ls_Fmt: String; li_Pos: Integer; {$IFDEF LANG} ls_File: String; {$ENDIF} begin //Shift+Ctrl起動で設定を読み込まない。AIU if (gfnbKeyState(VK_SHIFT) and gfnbKeyState(VK_CONTROL)) then begin Exit; end; l_IniFile := TMyIniFile.Create; with l_IniFile do begin try //倍率の設定は最初にやっておく F_iZoomIndex := gfniNumLimit(ReadInteger(lcsSECT_ZOOM, lcsKEY_ZOOMINDEX, mniZoom.Tag), 0, mniZoom.Count -1); actZoomExecute(mniZoom.Items[F_iZoomIndex].Action); //[Grid] actGrid_SelColor.Tag := ReadInteger(lcsSECT_GRID, lcsKEY_GRIDCOLOR, actGrid_SelColor.Tag); actGrid_SelSubColor.Tag := ReadInteger(lcsSECT_GRID, lcsKEY_GRIDSUBCOLOR, actGrid_SelSubColor.Tag); actGrid_SelSubElseColor.Tag := ReadInteger(lcsSECT_GRID, lcsKEY_GRIDSUBELSECOLOR, actGrid_SelSubElseColor.Tag); //グリッド色 li_Index := gfniNumLimit(ReadInteger(lcsSECT_GRID, lcsKEY_GRIDGRIDINDEX, mniGrid_Gray.MenuIndex), mniGrid_LineGrid.MenuIndex+1, mniGrid_LineSubGrid.MenuIndex-1); TAction(mniGrid.Items[li_Index].Action).Checked := True; actGrid_ColorExecute(mniGrid.Items[li_Index].Action); //サブグリッド色 li_Index := gfniNumLimit(ReadInteger(lcsSECT_GRID, lcsKEY_GRIDSUBGRIDINDEX, mniGrid_SubBlue.MenuIndex), mniGrid_LineSubGrid.MenuIndex+1, mniGrid.Count-1); TAction(mniGrid.Items[li_Index].Action).Checked := True; actGrid_SubColorExecute(mniGrid.Items[li_Index].Action); actGrid_Disp.Checked := ReadBool(lcsSECT_GRID, lcsKEY_GRIDDISP, actGrid_Disp.Checked); actGrid_UseSubElseColor.Checked := ReadBool(lcsSECT_GRID, lcsKEY_GRIDUSEELSECOLOR, actGrid_UseSubElseColor.Checked); actGrid_UseSubElseColorExecute(nil); //[Color] actColor_RGB.Checked := ReadBool(lcsSECT_COLOR, lcsKEY_COLORRGB, actColor_RGB.Checked); actColor_HTML.Checked := ReadBool(lcsSECT_COLOR, lcsKEY_COLORHTML, actColor_HTML.Checked); actColor_COLORREF.Checked := ReadBool(lcsSECT_COLOR, lcsKEY_COLORCOLORREF, actColor_COLORREF.Checked); actColor_HSV.Checked := ReadBool(lcsSECT_COLOR, lcsKEY_COLORHSV, actColor_HSV.Checked); actColor_HLS.Checked := ReadBool(lcsSECT_COLOR, lcsKEY_COLORHLS, actColor_HLS.Checked); actColor_HLSWin.Checked := ReadBool(lcsSECT_COLOR, lcsKEY_COLORHLSWIN, actColor_HLSWin.Checked); //[Position] actPos_Screen.Checked := ReadBool (lcsSECT_POS, lcsKEY_POSSCREEN, actPos_Screen.Checked); actPos_Monitor.Checked := ReadBool (lcsSECT_POS, lcsKEY_POSMONITOR, actPos_Monitor.Checked); actPos_Client.Checked := ReadBool (lcsSECT_POS, lcsKEY_POSCLIENT, actPos_Client.Checked); actPos_User.Checked := ReadBool (lcsSECT_POS, lcsKEY_POSUSER, actPos_User.Checked); FrDispInfo.ptUserPos := ReadPoint(lcsSECT_POS, lcsKEY_POSUSERPOS, Point(0, 0)); //LongIntの範囲内ならOKとする FrDispInfo.ptUserPos.X := gfniNumLimit(FrDispInfo.ptUserPos.X, Low(LongInt), High(LongInt)); FrDispInfo.ptUserPos.Y := gfniNumLimit(FrDispInfo.ptUserPos.Y, Low(LongInt), High(LongInt)); //[WindowInfo] actWinInfo_Handle.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINHANDLE, actWinInfo_Handle.Checked); actWinInfo_ClassName.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINCLASSNAME, actWinInfo_ClassName.Checked); actWinInfo_Text.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINTEXT, actWinInfo_Text.Checked); actWinInfo_WindowSize.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINWINDOWSIZE, actWinInfo_WindowSize.Checked); actWinInfo_ClientSize.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINCLIENTSIZE, actWinInfo_ClientSize.Checked); actWinInfo_Rect.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINRECT, actWinInfo_Rect.Checked); actWinInfo_ControlID.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINCONTROLID, actWinInfo_ControlID.Checked); actWinInfo_Style.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINSTYLE, actWinInfo_Style.Checked); actWinInfo_ParentWindow.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINPARENTWINDOW, actWinInfo_ParentWindow.Checked); actWinInfo_PID.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINPID, actWinInfo_PID.Checked); actWinInfo_ExeName.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINEXENAME, actWinInfo_ExeName.Checked); actWinInfo_FileVersion.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINFILEVERSION, actWinInfo_FileVersion.Checked); actWinInfo_StyleVerbose.Checked := ReadBool(lcsSECT_WININFO, lcsKEY_WINSTYLEVERBOSE, actWinInfo_StyleVerbose.Checked); // actWinInfo_StyleVerboseExecute(nil); フォームの表示位置を決定してから呼ぶ必要あり //[WindowStyle] with App_BugsEyeWindowStyle do begin chkButton.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEBUTTON, chkButton.Checked); chkComboBox.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLECOMBOBOX, chkComboBox.Checked); chkEdit.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEEDIT, chkEdit.Checked); chkListBox.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLELISTBOX, chkListBox.Checked); chkDialog.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEDIALOG, chkDialog.Checked); chkScrollBar.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLESCROLLBAR, chkScrollBar.Checked); chkStatic.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLESTATIC, chkStatic.Checked); end; actWinInfo_StyleFollowMain.Checked := ReadBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEFOLLOW, actWinInfo_StyleFollowMain.Checked); //[Option] actOpt_StayOnTop.Checked := ReadBool(lcsSECT_OPT, lcsKEY_OPTSTAYONTOP, actOpt_StayOntop.Checked); actOpt_StayOnTopExecute(actOpt_StayOnTop); actOpt_ToolBar.Checked := ReadBool(lcsSECT_OPT, lcsKEY_OPTTOOLBAR, actOpt_ToolBar.Checked); actOpt_ToolBarExecute(actOpt_ToolBar); actOpt_BigFont.Checked := ReadBool(lcsSECT_OPT, lcsKEY_OPTBIGFONT, actOpt_BigFont.Checked); actOpt_BigFontExecute(actOpt_BigFont); actOpt_NoSelfCapture.Checked := ReadBool(lcsSECT_OPT, lcsKEY_OPTNOSELFCAPTURE, actOpt_NoSelfCapture.Checked); actOpt_NoSelfCaptureExecute(nil); actCapture_Lupe.Checked := ReadBool(lcsSECT_OPT, lcsKEY_CAPTURELUPEMODE, actCapture_Lupe.Checked); actCapture_LupeExecute(nil); actCopy_OptUnicode.Checked := ReadBool(lcsSECT_OPT, lcsKEY_OPTUNICODE, actCopy_OptUnicode.Checked); //------------------------------------------------------------------------------ //準汎用フォーム用 //[Menu] gpcReadIniMenu(l_IniFile, mnuPopup); //[ToolBar] gpcReadIniToolBar(l_IniFile); //[ShortCut] gpcReadIniShortCut(l_IniFile, ActionList_Main); //------------------------------------------------------------------------------ lsl_List := TStringList.Create; try //[Copy] for i := 0 to G_ciFMTCOUNT do begin //初期値をセット F_SetCopyFmt(i, F_GetInitCopyFmt(i)); end; if (SectionExists(lcsSECT_COPY)) then begin ReadSectionText(lcsSECT_COPY, lsl_List); //変更されているフォーマット形式のみ列挙される //プログラムでの解析を簡単にするため ナンバー=フォーマット にする //例)カラー情報/RGB //1=%d, %d, %d for i := 0 to lsl_List.Count-1 do begin li_Pos := Pos('=', lsl_List[i]); if (li_Pos > 0) then begin li_Index := StrToIntDef(Trim(Copy(lsl_List[i], 0, li_Pos-1)), -1); if (li_Index >= 0) and (li_Index <= G_ciFMTCOUNT) then begin ls_Fmt := Copy(lsl_List[i], li_Pos+1, MAXINT); if (ls_Fmt <> '') and (ls_Fmt <> F_GetCopyFmt(li_Index)) then begin F_SetCopyFmt(li_Index, ls_Fmt); end; end; end; end; end; finally lsl_List.Free; end; //------------------------------------------------------------------------------ //[Bounds] if (gfnbKeyState(VK_SHIFT)) then begin //Shiftキーを押しながら起動で(0,0)に移動 Self.SetBounds(0, 0, Width, Height); Tag := 1; FormResize(nil); end else begin //フォームの大きさ。この処理は最後に持ってこないと拡大倍率セットのとこでエラーになる Self.BoundsRect := ReadBoundsRect(lcsSECT_BOUNDS, Self); Tag := 1; FormResize(nil); if not(gfnbKeyState(VK_CONTROL)) then begin //画面内に収まるように調整 //ただし情報エリアは画面外にはみ出して起動する場合あり。 MyMonitors.SetBounds(Self); end else begin //Ctrlキーを押して起動した場合は調整はせず設定ファイルに従った位置と大きさで起動 //何らかの意図で画面外に起動させたい場合にも対応。 end; end; actWinInfo_StyleVerboseExecute(nil); //フォームの表示位置を決定してから呼ぶ必要あり finally Free; end; end; {$IFDEF LANG} ls_File := gfnsFilePathGet(gfnsExeNameGet) + 'Lang\Default.lang'; if (gfnbFileExists(ls_File)) then begin l_IniFile := TMyIniFile.Create(ls_File); with l_IniFile do begin try for i := 0 to ActionList1.ActionCount-1 do begin l_Action := TAction(ActionList1.Actions[i]); if (SectionExists(l_Action.Name)) then begin l_Action.Category := ReadString(l_Action.Name, 'Category', l_Action.Category); l_Action.Caption := ReadString(l_Action.Name, 'Caption', l_Action.Caption); l_Action.Hint := ReadString(l_Action.Name, 'Hint', l_Action.Hint); end; end; finally Free; end; end; end; {$ENDIF} end; //設定データの保存 procedure TApp_BugsEye.F_SaveIni; procedure lpc_WriteMenu(AList: TStrings; AMenuItem: TMenuItem); var i: Integer; l_MenuItem: TMenuItem; begin for i := 0 to AMenuItem.Count-1 do begin l_MenuItem := AMenuItem.Items[i]; if (Copy(l_MenuItem.Name, 1, 2) = '__') then begin Continue; end; if not(l_MenuItem.Visible) then begin AList.Add(l_MenuItem.Name); end; if (l_MenuItem.Count > 0) then begin lpc_WriteMenu(AList, l_MenuItem); end; end; end; var l_IniFile: TMyIniFile; lrc_Rect: TRect; i, li_Index: Integer; begin //Shift+Ctrl終了で設定を書き込まない。 if (gfnbKeyState(VK_SHIFT) and gfnbKeyState(VK_CONTROL)) then begin Exit; end; l_IniFile := TMyIniFile.Create; with l_IniFile do begin try //[Bounds] lrc_Rect := BoundsRect; Dec(lrc_Rect.Bottom, gfniRectHeight(FrcInfo)); WriteRect(lcsSECT_BOUNDS, Self.Name, lrc_Rect); //[Zoom] WriteInteger(lcsSECT_ZOOM, lcsKEY_ZOOMINDEX, F_iZoomIndex); //[Grid] WriteBool(lcsSECT_GRID, lcsKEY_GRIDDISP, actGrid_Disp.Checked); //選択されているグリッドメニュー li_Index := mniGrid_Gray.MenuIndex; for i := mniGrid_LineGrid.MenuIndex +1 to mniGrid_LineSubGrid.MenuIndex -1 do begin if (mniGrid.Items[i].Checked) then begin li_Index := i; Break; end; end; WriteInteger(lcsSECT_GRID, lcsKEY_GRIDGRIDINDEX, li_Index); //選択されているサブグリッドメニュー li_Index := mniGrid_SubBlue.MenuIndex; for i := mniGrid_LineSubGrid.MenuIndex +1 to mniGrid.Count -1 do begin if (mniGrid.Items[i].Checked) then begin li_Index := i; Break; end; end; WriteInteger(lcsSECT_GRID, lcsKEY_GRIDSUBGRIDINDEX, li_Index); //選択色 WriteInteger(lcsSECT_GRID, lcsKEY_GRIDCOLOR, actGrid_SelColor.Tag); WriteInteger(lcsSECT_GRID, lcsKEY_GRIDSUBCOLOR, actGrid_SelSubColor.Tag); WriteInteger(lcsSECT_GRID, lcsKEY_GRIDSUBELSECOLOR, actGrid_SelSubElseColor.Tag); WriteBool (lcsSECT_GRID, lcsKEY_GRIDUSEELSECOLOR, actGrid_UseSubElseColor.Checked); //[Color] WriteBool(lcsSECT_COLOR, lcsKEY_COLORRGB, actColor_RGB.Checked); WriteBool(lcsSECT_COLOR, lcsKEY_COLORHTML, actColor_HTML.Checked); WriteBool(lcsSECT_COLOR, lcsKEY_COLORCOLORREF, actColor_COLORREF.Checked); WriteBool(lcsSECT_COLOR, lcsKEY_COLORHLSWIN, actColor_HLSWIN.Checked); WriteBool(lcsSECT_COLOR, lcsKEY_COLORHLS, actColor_HLS.Checked); WriteBool(lcsSECT_COLOR, lcsKEY_COLORHSV, actColor_HSV.Checked); //[Position] WriteBool (lcsSECT_POS, lcsKEY_POSSCREEN, actPos_Screen.Checked); WriteBool (lcsSECT_POS, lcsKEY_POSMONITOR, actPos_Monitor.Checked); WriteBool (lcsSECT_POS, lcsKEY_POSCLIENT, actPos_Client.Checked); WriteBool (lcsSECT_POS, lcsKEY_POSUSER, actPos_User.Checked); WritePoint(lcsSECT_POS, lcsKEY_POSUSERPOS, FrDispInfo.ptUserPos); //[WindowsInfo] WriteBool(lcsSECT_WININFO, lcsKEY_WINHANDLE, actWinInfo_Handle.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINCLASSNAME, actWinInfo_ClassName.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINTEXT, actWinInfo_Text.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINWINDOWSIZE, actWinInfo_WindowSize.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINCLIENTSIZE, actWinInfo_ClientSize.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINRECT, actWinInfo_Rect.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINCONTROLID, actWinInfo_ControlID.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINSTYLE, actWinInfo_Style.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINSTYLEVERBOSE, actWinInfo_StyleVerbose.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINPARENTWINDOW, actWinInfo_ParentWindow.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINPID, actWinInfo_PID.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINEXENAME, actWinInfo_ExeName.Checked); WriteBool(lcsSECT_WININFO, lcsKEY_WINFILEVERSION, actWinInfo_FileVersion.Checked); //[WindowStyle] with App_BugsEyeWindowStyle do begin WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEBUTTON, chkButton.Checked); WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLECOMBOBOX, chkComboBox.Checked); WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEEDIT, chkEdit.Checked); WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLELISTBOX, chkListBox.Checked); WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEDIALOG, chkDialog.Checked); WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLESCROLLBAR, chkScrollBar.Checked); WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLESTATIC, chkStatic.Checked); end; WriteBool(lcsSECT_WINSTYLE, lcsKEY_WINSTYLEFOLLOW, actWinInfo_StyleFollowMain.Checked); //[Option] WriteBool(lcsSECT_OPT, lcsKEY_OPTSTAYONTOP, actOpt_StayOnTop.Checked); WriteBool(lcsSECT_OPT, lcsKEY_OPTTOOLBAR, actOpt_ToolBar.Checked); WriteBool(lcsSECT_OPT, lcsKEY_OPTBIGFONT, actOpt_BigFont.Checked); WriteBool(lcsSECT_OPT, lcsKEY_OPTNOSELFCAPTURE, actOpt_NoSelfCapture.Checked); WriteBool(lcsSECT_OPT, lcsKEY_CAPTURELUPEMODE, actCapture_Lupe.Checked); WriteBool(lcsSECT_OPT, lcsKEY_OPTUNICODE, actCopy_OptUnicode.Checked); //------------------------------------------------------------------------------ //準汎用フォーム用 //[Menu] gpcWriteIniMenu(l_IniFile, mnuPopup); //[ToolBar] gpcWriteIniToolBar(l_IniFile, ToolBar_Main); //[ShortCut] gpcWriteIniShortCut(l_IniFile); //------------------------------------------------------------------------------ //[Copy] EraseSection(lcsSECT_COPY); for i := 0 to G_ciFMTCOUNT do begin if (F_GetCopyFmt(i) <> F_GetInitCopyFmt(i)) then begin WriteString(lcsSECT_COPY, IntToStr(i), F_GetCopyFmt(i)); end; end; UpdateFile; finally Free; end; end; end; *) function TApp_BugsEye.Get_IDMToMenuItem(iIDM: Word): TMenuItem; begin case iIDM of //[ズーム] G_ciIDM_ZOOM : Result := MenuItem_Zoom; G_ciIDM_ZOOM_1 : Result := MenuItem_Zoom_1; G_ciIDM_ZOOM_2 : Result := MenuItem_Zoom_2; G_ciIDM_ZOOM_3 : Result := MenuItem_Zoom_3; G_ciIDM_ZOOM_4 : Result := MenuItem_Zoom_4; G_ciIDM_ZOOM_6 : Result := MenuItem_Zoom_6; G_ciIDM_ZOOM_8 : Result := MenuItem_Zoom_8; G_ciIDM_ZOOM_10 : Result := MenuItem_Zoom_10; G_ciIDM_ZOOM_12 : Result := MenuItem_Zoom_12; G_ciIDM_ZOOM_16 : Result := MenuItem_Zoom_16; G_ciIDM_ZOOM_20 : Result := MenuItem_Zoom_20; //[グリッド] G_ciIDM_GRID : Result := MenuItem_Grid; G_ciIDM_GRID_DISP : Result := MenuItem_Grid_Disp; G_ciIDM_GRID_LINEGRID : Result := MenuItem_Grid_LineGrid; G_ciIDM_GRID_GRAY : Result := MenuItem_Grid_Gray; G_ciIDM_GRID_BLACK : Result := MenuItem_Grid_Black; G_ciIDM_GRID_WITE : Result := MenuItem_Grid_White; G_ciIDM_GRID_INVERT : Result := MenuItem_Grid_Invert; G_ciIDM_GRID_TRANSPARENT : Result := MenuItem_Grid_Transparent; G_ciIDM_GRID_SELCOLOR : Result := MenuItem_Grid_SelColor; G_ciIDM_GRID_LINESUBGRID : Result := MenuItem_Grid_LineSubGrid; G_ciIDM_GRID_SUBNONE : Result := MenuItem_Grid_SubNone; G_ciIDM_GRID_SUBBLUE : Result := MenuItem_Grid_SubBlue; G_ciIDM_GRID_SUBRED : Result := MenuItem_Grid_SubRed; G_ciIDM_GRID_SELSUBCOLOR : Result := MenuItem_Grid_SelSubColor; G_ciIDM_GRID_LINESUBGRID2 : Result := MenuItem_Grid_LineSubGrid2; G_ciIDM_GRID_USESUBELSECOLOR : Result := MenuItem_Grid_UseSubElseColor; G_ciIDM_GRID_SELSUBELSECOLOR : Result := MenuItem_Grid_SelSubElseColor; //[-] G_ciIDM_MAIN_LINE1 : Result := MenuItem_Main_Line1; //[カラー情報] G_ciIDM_COLOR : Result := MenuItem_Color; G_ciIDM_COLOR_RGB : Result := MenuItem_Color_RGB; G_ciIDM_COLOR_HTML : Result := MenuItem_Color_HTML; G_ciIDM_COLOR_COLORREF : Result := MenuItem_Color_ColorRef; G_ciIDM_COLOR_HSV : Result := MenuItem_Color_HSV; G_ciIDM_COLOR_HLS : Result := MenuItem_Color_HLS; G_ciIDM_COLOR_HLSWIN : Result := MenuItem_Color_HLSWin; G_ciIDM_COLOR_LINE1 : Result := MenuItem_Color_Line1; G_ciIDM_COLOR_INFOONOFF : Result := MenuItem_Color_InfoOnOff; //[カーソル位置] G_ciIDM_POS : Result := MenuItem_Pos; G_ciIDM_POS_SCREEN : Result := MenuItem_Pos_Screen; G_ciIDM_POS_MONITOR : Result := MenuItem_Pos_Monitor; G_ciIDM_POS_CLIENT : Result := MenuItem_Pos_Client; G_ciIDM_POS_LENGTH : Result := MenuItem_Pos_Length; { G_ciIDM_POS_LOGICALSCREEN : Result := MenuItem_Pos_LogicalScreen; G_ciIDM_POS_LOGICALMONITOR : Result := MenuItem_Pos_LogicalMonitor; G_ciIDM_POS_LOGICALCLIENT : Result := MenuItem_Pos_LogicalClient; G_ciIDM_POS_LOGICALLENGTH : Result := MenuItem_Pos_LogicalLength; } G_ciIDM_POS_LINE1 : Result := MenuItem_Pos_Line1; G_ciIDM_POS_INFOONOFF : Result := MenuItem_Pos_InfoOnOff; //[ウィンドウ情報] G_ciIDM_WININFO : Result := MenuItem_WinInfo; G_ciIDM_WININFO_HANDLE : Result := MenuItem_WinInfo_Handle; G_ciIDM_WININFO_CLASSNAME : Result := MenuItem_WinInfo_ClassName; G_ciIDM_WININFO_TEXT : Result := MenuItem_WinInfo_Text; G_ciIDM_WININFO_WINDOWSIZE : Result := MenuItem_WinInfo_WindowSize; G_ciIDM_WININFO_CLIENTSIZE : Result := MenuItem_WinInfo_ClientSize; G_ciIDM_WININFO_RECT : Result := MenuItem_WinInfo_Rect; G_ciIDM_WININFO_CONTROLID : Result := MenuItem_WinInfo_ControlID; G_ciIDM_WININFO_STYLE : Result := MenuItem_WinInfo_Style; G_ciIDM_WININFO_PARENTWINDOW : Result := MenuItem_WinInfo_ParentWindow; G_ciIDM_WININFO_PID : Result := MenuItem_WinInfo_PID; G_ciIDM_WININFO_EXENAME : Result := MenuItem_WinInfo_ExeName; G_ciIDM_WININFO_FILEVERSION : Result := MenuItem_WinInfo_FileVersion; G_ciIDM_WININFO_LINE1 : Result := MenuItem_WinInfo_Line1; G_ciIDM_WININFO_STYLEVERBOSE : Result := MenuItem_WinInfo_StyleVerbose; G_ciIDM_WININFO_LINE2 : Result := MenuItem_WinInfo_Line2; G_ciIDM_WININFO_INFOONOFF : Result := MenuItem_WinInfo_InfoOnOff; //[-] G_ciIDM_MAIN_LINE2 : Result := MenuItem_Main_Line2; //[コピー] G_ciIDM_COPY : Result := MenuItem_Copy; G_ciIDM_COPY_PICTURE : Result := MenuItem_Copy_Picture; G_ciIDM_COPY_LINE1 : Result := MenuItem_Copy_Line1; G_ciIDM_COPY_COLORRGB : Result := MenuItem_Copy_ColorRGB; G_ciIDM_COPY_COLORRGBRED : Result := MenuItem_Copy_ColorRGBRed; G_ciIDM_COPY_COLORRGBGREEN : Result := MenuItem_Copy_ColorRGBGreen; G_ciIDM_COPY_COLORRGBBLUE : Result := MenuItem_Copy_ColorRGBBlue; G_ciIDM_COPY_COLORHTML : Result := MenuItem_Copy_ColorHTML; G_ciIDM_COPY_COLORCOLORREF : Result := MenuItem_Copy_ColorColorRef; G_ciIDM_COPY_COLORHSV : Result := MenuItem_Copy_ColorHSV; G_ciIDM_COPY_COLORHSVHUE : Result := MenuItem_Copy_ColorHSVHue; G_ciIDM_COPY_COLORHSVSATURATION : Result := MenuItem_Copy_ColorHSVSaturation; G_ciIDM_COPY_COLORHSVVALUE : Result := MenuItem_Copy_ColorHSVValue; G_ciIDM_COPY_COLORHLS : Result := MenuItem_Copy_ColorHLS; G_ciIDM_COPY_COLORHLSHUE : Result := MenuItem_Copy_ColorHLSHue; G_ciIDM_COPY_COLORHLSSATURATION : Result := MenuItem_Copy_ColorHLSSaturation; G_ciIDM_COPY_COLORHLSLIGHTNESS : Result := MenuItem_Copy_ColorHLSLightness; G_ciIDM_COPY_COLORHLSWIN : Result := MenuItem_Copy_ColorHLSWin; G_ciIDM_COPY_COLORHLSWINHUE : Result := MenuItem_Copy_ColorHLSWinHue; G_ciIDM_COPY_COLORHLSWINSATURATION : Result := MenuItem_Copy_ColorHLSWinSaturation; G_ciIDM_COPY_COLORHLSWINLIGHTNESS : Result := MenuItem_Copy_ColorHLSWinLightness; G_ciIDM_COPY_LINE2 : Result := MenuItem_Copy_Line2; G_ciIDM_COPY_POSSCREEN : Result := MenuItem_Copy_PosScreen; G_ciIDM_COPY_POSSCREEN_X : Result := MenuItem_Copy_PosScreenX; G_ciIDM_COPY_POSSCREEN_Y : Result := MenuItem_Copy_PosScreenY; G_ciIDM_COPY_POSMONITOR : Result := MenuItem_Copy_PosMonitor; G_ciIDM_COPY_POSMONITOR_X : Result := MenuItem_Copy_PosMonitorX; G_ciIDM_COPY_POSMONITOR_Y : Result := MenuItem_Copy_PosMonitorY; G_ciIDM_COPY_POSCLIENT : Result := MenuItem_Copy_PosClient; G_ciIDM_COPY_POSCLIENT_X : Result := MenuItem_Copy_PosClientX; G_ciIDM_COPY_POSCLIENT_Y : Result := MenuItem_Copy_PosClientY; G_ciIDM_COPY_POSUSER : Result := MenuItem_Copy_PosUser; G_ciIDM_COPY_POSUSER_WIDTH : Result := MenuItem_Copy_PosUserWidth; G_ciIDM_COPY_POSUSER_HEIGHT : Result := MenuItem_Copy_PosUserHeight; G_ciIDM_COPY_LINE3 : Result := MenuItem_Copy_Line3; G_ciIDM_COPY_WININFOHANDLE : Result := MenuItem_Copy_WinInfoHandle; G_ciIDM_COPY_WININFOCLASSNAME : Result := MenuItem_Copy_WinInfoClassName; G_ciIDM_COPY_WININFOTEXT : Result := MenuItem_Copy_WinInfoText; G_ciIDM_COPY_WININFOWINDOWSIZE : Result := MenuItem_Copy_WinInfoWindowSize; G_ciIDM_COPY_WININFOWINDOWSIZE_LEFT : Result := MenuItem_Copy_WinInfoWindowSizeLeft; G_ciIDM_COPY_WININFOWINDOWSIZE_TOP : Result := MenuItem_Copy_WinInfoWindowSizeTop; G_ciIDM_COPY_WININFOWINDOWSIZE_WIDTH : Result := MenuItem_Copy_WinInfoWindowSizeWidth; G_ciIDM_COPY_WININFOWINDOWSIZE_HEIGHT : Result := MenuItem_Copy_WinInfoWindowSizeHeight; G_ciIDM_COPY_WININFOCLIENTSIZE : Result := MenuItem_Copy_WinInfoClientSize; G_ciIDM_COPY_WININFOCLIENTSIZE_WIDTH : Result := MenuItem_Copy_WinInfoClientSizeWidth; G_ciIDM_COPY_WININFOCLIENTSIZE_HEIGHT : Result := MenuItem_Copy_WinInfoClientSizeHeight; G_ciIDM_COPY_WININFORECT : Result := MenuItem_Copy_WinInfoRect; G_ciIDM_COPY_WININFORECT_LEFT : Result := MenuItem_Copy_WinInfoRectLeft; G_ciIDM_COPY_WININFORECT_TOP : Result := MenuItem_Copy_WinInfoRectTop; G_ciIDM_COPY_WININFORECT_RIGHT : Result := MenuItem_Copy_WinInfoRectRight; G_ciIDM_COPY_WININFORECT_BOTTOM : Result := MenuItem_Copy_WinInfoRectBottom; G_ciIDM_COPY_WININFOCONTROLID : Result := MenuItem_Copy_WinInfoControlID; G_ciIDM_COPY_WININFOSTYLE : Result := MenuItem_Copy_WinInfoStyle; G_ciIDM_COPY_WININFOSTYLEEX : Result := MenuItem_Copy_WinInfoStyleEx; G_ciIDM_COPY_WININFOPID : Result := MenuItem_Copy_WinInfoPID; G_ciIDM_COPY_WININFOEXENAME : Result := MenuItem_Copy_WinInfoExeName; G_ciIDM_COPY_WININFOFILEVERSION : Result := MenuItem_Copy_WinInfoFileVersion; // G_ciIDM_COPY_WININFOSTYLEVERBOSE : Result := MenuItem_Copy_WinInfoStyleVerbose; G_ciIDM_COPY_LINE4 : Result := MenuItem_Copy_Line4; G_ciIDM_COPY_ALL : Result := MenuItem_Copy_All; // G_ciIDM_COPY_LINE5 : Result := MenuItem_Copy_Line5; // G_ciIDM_COPY_OPT_UNICODE : Result := MenuItem_Copy_OptUnicode; G_ciIDM_WRITE : Result := MenuItem_Write; G_ciIDM_WRITE_INFOCASH : Result := MenuItem_Write_InfoCash; G_ciIDM_WRITE_CLEARCASH : Result := MenuItem_Write_ClearCash; G_ciIDM_WRITE_CLIPBOARD : Result := MenuItem_Write_ClipboardText; G_ciIDM_WRITE_TEXTCLEAR : Result := MenuItem_Write_TextClear; G_ciIDM_WRITE_LINE1 : Result := MenuItem_Write_Line1; G_ciIDM_WRITE_COLORRGB : Result := MenuItem_Write_ColorRGB; G_ciIDM_WRITE_COLORRGBRED : Result := MenuItem_Write_ColorRGBRed; G_ciIDM_WRITE_COLORRGBGREEN : Result := MenuItem_Write_ColorRGBGreen; G_ciIDM_WRITE_COLORRGBBLUE : Result := MenuItem_Write_ColorRGBBlue; G_ciIDM_WRITE_COLORHTML : Result := MenuItem_Write_ColorHTML; G_ciIDM_WRITE_COLORCOLORREF : Result := MenuItem_Write_ColorCOLORREF; G_ciIDM_WRITE_COLORHSV : Result := MenuItem_Write_ColorHSV; G_ciIDM_WRITE_COLORHSVHUE : Result := MenuItem_Write_ColorHSVHue; G_ciIDM_WRITE_COLORHSVSATURATION : Result := MenuItem_Write_ColorHSVSaturation; G_ciIDM_WRITE_COLORHSVVALUE : Result := MenuItem_Write_ColorHSVValue; G_ciIDM_WRITE_COLORHLS : Result := MenuItem_Write_ColorHLS; G_ciIDM_WRITE_COLORHLSHUE : Result := MenuItem_Write_ColorHLSHue; G_ciIDM_WRITE_COLORHLSSATURATION : Result := MenuItem_Write_ColorHLSSaturation; G_ciIDM_WRITE_COLORHLSLIGHTNESS : Result := MenuItem_Write_ColorHLSLightness; G_ciIDM_WRITE_COLORHLSWIN : Result := MenuItem_Write_ColorHLSWin; G_ciIDM_WRITE_COLORHLSWINHUE : Result := MenuItem_Write_ColorHLSWinHue; G_ciIDM_WRITE_COLORHLSWINSATURATION : Result := MenuItem_Write_ColorHLSWinSaturation; G_ciIDM_WRITE_COLORHLSWINLIGHTNESS : Result := MenuItem_Write_ColorHLSWinLightness; G_ciIDM_WRITE_LINE2 : Result := MenuItem_Write_Line2; G_ciIDM_WRITE_POSSCREEN : Result := MenuItem_Write_PosScreen; G_ciIDM_WRITE_POSSCREEN_X : Result := MenuItem_Write_PosScreenX; G_ciIDM_WRITE_POSSCREEN_Y : Result := MenuItem_Write_PosScreenY; G_ciIDM_WRITE_POSMONITOR : Result := MenuItem_Write_PosMonitor; G_ciIDM_WRITE_POSMONITOR_X : Result := MenuItem_Write_PosMonitorX; G_ciIDM_WRITE_POSMONITOR_Y : Result := MenuItem_Write_PosMonitorY; G_ciIDM_WRITE_POSCLIENT : Result := MenuItem_Write_PosClient; G_ciIDM_WRITE_POSCLIENT_X : Result := MenuItem_Write_PosClientX; G_ciIDM_WRITE_POSCLIENT_Y : Result := MenuItem_Write_PosClientY; G_ciIDM_WRITE_POSUSER : Result := MenuItem_Write_PosUser; G_ciIDM_WRITE_POSUSER_WIDTH : Result := MenuItem_Write_PosUserWidth; G_ciIDM_WRITE_POSUSER_HEIGHT : Result := MenuItem_Write_PosUserHeight; G_ciIDM_WRITE_LINE3 : Result := MenuItem_Write_Line3; G_ciIDM_WRITE_WININFOHANDLE : Result := MenuItem_Write_WinInfoHandle; G_ciIDM_WRITE_WININFOCLASSNAME : Result := MenuItem_Write_WinInfoClassName; G_ciIDM_WRITE_WININFOTEXT : Result := MenuItem_Write_WinInfoText; G_ciIDM_WRITE_WININFOWINDOWSIZE : Result := MenuItem_Write_WinInfoWindowSize; G_ciIDM_WRITE_WININFOWINDOWSIZE_LEFT : Result := MenuItem_Write_WinInfoWindowSizeLeft; G_ciIDM_WRITE_WININFOWINDOWSIZE_TOP : Result := MenuItem_Write_WinInfoWindowSizeTop; G_ciIDM_WRITE_WININFOWINDOWSIZE_WIDTH : Result := MenuItem_Write_WinInfoWindowSizeWidth; G_ciIDM_WRITE_WININFOWINDOWSIZE_HEIGHT : Result := MenuItem_Write_WinInfoWindowSizeHeight; G_ciIDM_WRITE_WININFOCLIENTSIZE : Result := MenuItem_Write_WinInfoClientSize; G_ciIDM_WRITE_WININFOCLIENTSIZE_WIDTH : Result := MenuItem_Write_WinInfoClientSizeWidth; G_ciIDM_WRITE_WININFOCLIENTSIZE_HEIGHT : Result := MenuItem_Write_WinInfoClientSizeHeight; G_ciIDM_WRITE_WININFORECT : Result := MenuItem_Write_WinInfoRect; G_ciIDM_WRITE_WININFORECT_LEFT : Result := MenuItem_Write_WinInfoRectLeft; G_ciIDM_WRITE_WININFORECT_TOP : Result := MenuItem_Write_WinInfoRectTop; G_ciIDM_WRITE_WININFORECT_RIGHT : Result := MenuItem_Write_WinInfoRectRight; G_ciIDM_WRITE_WININFORECT_BOTTOM : Result := MenuItem_Write_WinInfoRectBottom; G_ciIDM_WRITE_WININFOCONTROLID : Result := MenuItem_Write_WinInfoControlID; G_ciIDM_WRITE_WININFOSTYLE : Result := MenuItem_Write_WinInfoStyle; G_ciIDM_WRITE_WININFOSTYLEEX : Result := MenuItem_Write_WinInfoStyleEx; // G_ciIDM_WRITE_WININFOSTYLEVERBOSE : Result := MenuItem_Write_WinInfoStyleVerbose; G_ciIDM_WRITE_WININFOPID : Result := MenuItem_Write_WinInfoPID; G_ciIDM_WRITE_WININFOEXENAME : Result := MenuItem_Write_WinInfoExeName; G_ciIDM_WRITE_WININFOFILEVERSION : Result := MenuItem_Write_WinInfoFileVersion; //[キャプチャ] G_ciIDM_CAPTURE : Result := MenuItem_Capture; G_ciIDM_CAPTURE_PAUSE : Result := MenuItem_Capture_Pause; G_ciIDM_CAPTURE_UPDATE : Result := MenuItem_Capture_Update; G_ciIDM_CAPTURE_LINE1 : Result := MenuItem_Capture_Line1; G_ciIDM_CAPTURE_LUPE : Result := MenuItem_Capture_Lupe; G_ciIDM_CAPTURE_FIXED : Result := MenuItem_Capture_Fixed; G_ciIDM_CAPTURE_LINE2 : Result := MenuItem_Capture_Line2; G_ciIDM_OPT_NOSELFCAPTURE : Result := MenuItem_Capture_NoSelfCapture; G_ciIDM_OPT_SMOOTHCAPTURE : Result := MenuItem_Capture_SmoothCapture; G_ciIDM_TEST_FLIP : Result := MenuItem_Test_Flip; G_ciIDM_TEST_FLIPNONE : Result := MenuItem_Test_FlipNone; G_ciIDM_TEST_FLIPHORIZONTAL : Result := MenuItem_Test_FlipHorizontal; G_ciIDM_TEST_FLIPVERTICAL : Result := MenuItem_Test_FlipVertical; G_ciIDM_TEST_ROTATE90 : Result := MenuItem_Test_Rotate90; G_ciIDM_TEST_ROTATE270 : Result := MenuItem_Test_Rotate270; G_ciIDM_TEST_ROTATE180 : Result := MenuItem_Test_Rotate180; //[オプション] G_ciIDM_CUSTOMIZE : Result := MenuItem_Customize; G_ciIDM_OPT_STAYONTOP : Result := MenuItem_Opt_StayOnTop; G_ciIDM_OPT_TITLEBAR : Result := MenuItem_Opt_TitleBar; G_ciIDM_OPT_TOOLBAR : Result := MenuItem_Opt_ToolBar; G_ciIDM_OPT_LARGEICON : Result := MenuItem_Opt_LargeIcon; G_ciIDM_OPT_ZOOMWHEEL : Result := MenuItem_Opt_ZoomWheel; G_ciIDM_OPT_LINETO : Result := MenuItem_Opt_LineTo; G_ciIDM_OPT_FONTSIZE : Result := MenuItem_Opt_SelFont; // G_ciIDM_OPT_SELBKCOLOR : Result := MenuItem_Opt_SelBkColor; G_ciIDM_OPT_LINE1 : Result := MenuItem_Opt_Line1; G_ciIDM_TEST : Result := MenuItem_Test; //暫定でコメントアウト // G_ciIDM_TEST_APITEST : Result := MenuItem_Test_DispAPITest; // G_ciIDM_TEST_AEROTHEMEONOFF : Result := MenuItem_Test_AeroThemeOnOff; G_ciIDM_OPT_LINE2 : Result := MenuItem_Opt_Line2; G_ciIDM_CUSTOMIZE_SETTING : Result := MenuItem_Customize_Setting; G_ciIDM_CUSTOMIZE_MENU : Result := MenuItem_Customize_Menu; G_ciIDM_CUSTOMIZE_TOOLBAR : Result := MenuItem_Customize_ToolBar; G_ciIDM_CUSTOMIZE_SHORTCUT : Result := MenuItem_Customize_ShortCut; G_ciIDM_CUSTOMIZE_COPY : Result := MenuItem_Customize_Copy; //[-] G_ciIDM_MAIN_LINE3 : Result := MenuItem_Main_Line3; //[バージョン情報] G_ciIDM_HELP : Result := MenuItem_Help; //[最小化] G_ciIDM_FILE_MINIMIZE : Result := MenuItem_File_Minimize; //[-] G_ciIDM_MAIN_LINE4 : Result := MenuItem_Main_Line4; //[終了] G_ciIDM_FILE_EXIT : Result := MenuItem_File_Exit; else Result := nil; end; end; function TApp_BugsEye.Get_MenuItemToIDM(AMenuItem: TMenuItem): Word; begin //[ズーム] if (AMenuItem = MenuItem_Zoom) then Result := G_ciIDM_ZOOM else if (AMenuItem = MenuItem_Zoom_1) then Result := G_ciIDM_ZOOM_1 else if (AMenuItem = MenuItem_Zoom_2) then Result := G_ciIDM_ZOOM_2 else if (AMenuItem = MenuItem_Zoom_3) then Result := G_ciIDM_ZOOM_3 else if (AMenuItem = MenuItem_Zoom_4) then Result := G_ciIDM_ZOOM_4 else if (AMenuItem = MenuItem_Zoom_6) then Result := G_ciIDM_ZOOM_6 else if (AMenuItem = MenuItem_Zoom_8) then Result := G_ciIDM_ZOOM_8 else if (AMenuItem = MenuItem_Zoom_10) then Result := G_ciIDM_ZOOM_10 else if (AMenuItem = MenuItem_Zoom_12) then Result := G_ciIDM_ZOOM_12 else if (AMenuItem = MenuItem_Zoom_16) then Result := G_ciIDM_ZOOM_16 else if (AMenuItem = MenuItem_Zoom_20) then Result := G_ciIDM_ZOOM_20 //[グリッド] else if (AMenuItem = MenuItem_Grid) then Result := G_ciIDM_GRID else if (AMenuItem = MenuItem_Grid_Disp) then Result := G_ciIDM_GRID_DISP else if (AMenuItem = MenuItem_Grid_LineGrid) then Result := G_ciIDM_GRID_LINEGRID else if (AMenuItem = MenuItem_Grid_Gray) then Result := G_ciIDM_GRID_GRAY else if (AMenuItem = MenuItem_Grid_Black) then Result := G_ciIDM_GRID_BLACK else if (AMenuItem = MenuItem_Grid_White) then Result := G_ciIDM_GRID_WITE else if (AMenuItem = MenuItem_Grid_Invert) then Result := G_ciIDM_GRID_INVERT else if (AMenuItem = MenuItem_Grid_Transparent) then Result := G_ciIDM_GRID_TRANSPARENT else if (AMenuItem = MenuItem_Grid_SelColor) then Result := G_ciIDM_GRID_SELCOLOR else if (AMenuItem = MenuItem_Grid_LineSubGrid) then Result := G_ciIDM_GRID_LINESUBGRID else if (AMenuItem = MenuItem_Grid_SubNone) then Result := G_ciIDM_GRID_SUBNONE else if (AMenuItem = MenuItem_Grid_SubBlue) then Result := G_ciIDM_GRID_SUBBLUE else if (AMenuItem = MenuItem_Grid_SubRed) then Result := G_ciIDM_GRID_SUBRED else if (AMenuItem = MenuItem_Grid_SelSubColor) then Result := G_ciIDM_GRID_SELSUBCOLOR else if (AMenuItem = MenuItem_Grid_LineSubGrid2) then Result := G_ciIDM_GRID_LINESUBGRID2 else if (AMenuItem = MenuItem_Grid_UseSubElseColor) then Result := G_ciIDM_GRID_USESUBELSECOLOR else if (AMenuItem = MenuItem_Grid_SelSubElseColor) then Result := G_ciIDM_GRID_SELSUBELSECOLOR //[-] else if (AMenuItem = MenuItem_Main_Line1) then Result := G_ciIDM_MAIN_LINE1 //[カラー情報] else if (AMenuItem = MenuItem_Color) then Result := G_ciIDM_COLOR else if (AMenuItem = MenuItem_Color_RGB) then Result := G_ciIDM_COLOR_RGB else if (AMenuItem = MenuItem_Color_HTML) then Result := G_ciIDM_COLOR_HTML else if (AMenuItem = MenuItem_Color_ColorRef) then Result := G_ciIDM_COLOR_COLORREF else if (AMenuItem = MenuItem_Color_HSV) then Result := G_ciIDM_COLOR_HSV else if (AMenuItem = MenuItem_Color_HLS) then Result := G_ciIDM_COLOR_HLS else if (AMenuItem = MenuItem_Color_HLSWin) then Result := G_ciIDM_COLOR_HLSWIN else if (AMenuItem = MenuItem_Color_Line1) then Result := G_ciIDM_COLOR_LINE1 else if (AMenuItem = MenuItem_Color_InfoOnOff) then Result := G_ciIDM_COLOR_INFOONOFF //[カーソル位置] else if (AMenuItem = MenuItem_Pos) then Result := G_ciIDM_POS else if (AMenuItem = MenuItem_Pos_Screen) then Result := G_ciIDM_POS_SCREEN else if (AMenuItem = MenuItem_Pos_Monitor) then Result := G_ciIDM_POS_MONITOR else if (AMenuItem = MenuItem_Pos_Client) then Result := G_ciIDM_POS_CLIENT else if (AMenuItem = MenuItem_Pos_Length) then Result := G_ciIDM_POS_LENGTH { else if (AMenuItem = MenuItem_Pos_LogicalScreen) then Result := G_ciIDM_POS_LOGICALSCREEN else if (AMenuItem = MenuItem_Pos_LogicalMonitor) then Result := G_ciIDM_POS_LOGICALMONITOR else if (AMenuItem = MenuItem_Pos_LogicalClient) then Result := G_ciIDM_POS_LOGICALCLIENT else if (AMenuItem = MenuItem_Pos_LogicalLength) then Result := G_ciIDM_POS_LOGICALLENGTH } else if (AMenuItem = MenuItem_Pos_Line1) then Result := G_ciIDM_POS_LINE1 else if (AMenuItem = MenuItem_Pos_InfoOnOff) then Result := G_ciIDM_POS_INFOONOFF //[ウィンドウ情報] else if (AMenuItem = MenuItem_WinInfo) then Result := G_ciIDM_WININFO else if (AMenuItem = MenuItem_WinInfo_Handle) then Result := G_ciIDM_WININFO_HANDLE else if (AMenuItem = MenuItem_WinInfo_ClassName) then Result := G_ciIDM_WININFO_CLASSNAME else if (AMenuItem = MenuItem_WinInfo_Text) then Result := G_ciIDM_WININFO_TEXT else if (AMenuItem = MenuItem_WinInfo_WindowSize) then Result := G_ciIDM_WININFO_WINDOWSIZE else if (AMenuItem = MenuItem_WinInfo_ClientSize) then Result := G_ciIDM_WININFO_CLIENTSIZE else if (AMenuItem = MenuItem_WinInfo_Rect) then Result := G_ciIDM_WININFO_RECT else if (AMenuItem = MenuItem_WinInfo_ControlID) then Result := G_ciIDM_WININFO_CONTROLID else if (AMenuItem = MenuItem_WinInfo_Style) then Result := G_ciIDM_WININFO_STYLE else if (AMenuItem = MenuItem_WinInfo_ParentWindow) then Result := G_ciIDM_WININFO_PARENTWINDOW else if (AMenuItem = MenuItem_WinInfo_PID) then Result := G_ciIDM_WININFO_PID else if (AMenuItem = MenuItem_WinInfo_ExeName) then Result := G_ciIDM_WININFO_EXENAME else if (AMenuItem = MenuItem_WinInfo_FileVersion) then Result := G_ciIDM_WININFO_FILEVERSION else if (AMenuItem = MenuItem_WinInfo_Line1) then Result := G_ciIDM_WININFO_LINE1 else if (AMenuItem = MenuItem_WinInfo_StyleVerbose) then Result := G_ciIDM_WININFO_STYLEVERBOSE else if (AMenuItem = MenuItem_WinInfo_Line2) then Result := G_ciIDM_WININFO_LINE2 else if (AMenuItem = MenuItem_WinInfo_InfoOnOff) then Result := G_ciIDM_WININFO_INFOONOFF //[-] else if (AMenuItem = MenuItem_Main_Line2) then Result := G_ciIDM_MAIN_LINE2 //[コピー] else if (AMenuItem = MenuItem_Copy) then Result := G_ciIDM_COPY else if (AMenuItem = MenuItem_Copy_Picture) then Result := G_ciIDM_COPY_PICTURE else if (AMenuItem = MenuItem_Copy_Line1) then Result := G_ciIDM_COPY_LINE1 else if (AMenuItem = MenuItem_Copy_ColorRGB) then Result := G_ciIDM_COPY_COLORRGB else if (AMenuItem = MenuItem_Copy_ColorRGBRed) then Result := G_ciIDM_COPY_COLORRGBRED else if (AMenuItem = MenuItem_Copy_ColorRGBGreen) then Result := G_ciIDM_COPY_COLORRGBGREEN else if (AMenuItem = MenuItem_Copy_ColorRGBBlue) then Result := G_ciIDM_COPY_COLORRGBBLUE else if (AMenuItem = MenuItem_Copy_ColorHTML) then Result := G_ciIDM_COPY_COLORHTML else if (AMenuItem = MenuItem_Copy_ColorColorRef) then Result := G_ciIDM_COPY_COLORCOLORREF else if (AMenuItem = MenuItem_Copy_ColorHSV) then Result := G_ciIDM_COPY_COLORHSV else if (AMenuItem = MenuItem_Copy_ColorHSVHue) then Result := G_ciIDM_COPY_COLORHSVHUE else if (AMenuItem = MenuItem_Copy_ColorHSVSaturation) then Result := G_ciIDM_COPY_COLORHSVSATURATION else if (AMenuItem = MenuItem_Copy_ColorHSVValue) then Result := G_ciIDM_COPY_COLORHSVVALUE else if (AMenuItem = MenuItem_Copy_ColorHLS) then Result := G_ciIDM_COPY_COLORHLS else if (AMenuItem = MenuItem_Copy_ColorHLSHue) then Result := G_ciIDM_COPY_COLORHLSHUE else if (AMenuItem = MenuItem_Copy_ColorHLSSaturation) then Result := G_ciIDM_COPY_COLORHLSSATURATION else if (AMenuItem = MenuItem_Copy_ColorHLSLightness) then Result := G_ciIDM_COPY_COLORHLSLIGHTNESS else if (AMenuItem = MenuItem_Copy_ColorHLSWin) then Result := G_ciIDM_COPY_COLORHLSWIN else if (AMenuItem = MenuItem_Copy_ColorHLSWinHue) then Result := G_ciIDM_COPY_COLORHLSWINHUE else if (AMenuItem = MenuItem_Copy_ColorHLSWinSaturation) then Result := G_ciIDM_COPY_COLORHLSWINSATURATION else if (AMenuItem = MenuItem_Copy_ColorHLSWinLightness) then Result := G_ciIDM_COPY_COLORHLSWINLIGHTNESS else if (AMenuItem = MenuItem_Copy_Line2) then Result := G_ciIDM_COPY_LINE2 else if (AMenuItem = MenuItem_Copy_PosScreen) then Result := G_ciIDM_COPY_POSSCREEN else if (AMenuItem = MenuItem_Copy_PosScreenX) then Result := G_ciIDM_COPY_POSSCREEN_X else if (AMenuItem = MenuItem_Copy_PosScreenY) then Result := G_ciIDM_COPY_POSSCREEN_Y else if (AMenuItem = MenuItem_Copy_PosMonitor) then Result := G_ciIDM_COPY_POSMONITOR else if (AMenuItem = MenuItem_Copy_PosMonitorX) then Result := G_ciIDM_COPY_POSMONITOR_X else if (AMenuItem = MenuItem_Copy_PosMonitorY) then Result := G_ciIDM_COPY_POSMONITOR_Y else if (AMenuItem = MenuItem_Copy_PosClient) then Result := G_ciIDM_COPY_POSCLIENT else if (AMenuItem = MenuItem_Copy_PosClientX) then Result := G_ciIDM_COPY_POSCLIENT_X else if (AMenuItem = MenuItem_Copy_PosClientY) then Result := G_ciIDM_COPY_POSCLIENT_Y else if (AMenuItem = MenuItem_Copy_PosUser) then Result := G_ciIDM_COPY_POSUSER else if (AMenuItem = MenuItem_Copy_PosUserWidth) then Result := G_ciIDM_COPY_POSUSER_WIDTH else if (AMenuItem = MenuItem_Copy_PosUserHeight) then Result := G_ciIDM_COPY_POSUSER_HEIGHT else if (AMenuItem = MenuItem_Copy_Line3) then Result := G_ciIDM_COPY_LINE3 else if (AMenuItem = MenuItem_Copy_WinInfoHandle) then Result := G_ciIDM_COPY_WININFOHANDLE else if (AMenuItem = MenuItem_Copy_WinInfoClassName) then Result := G_ciIDM_COPY_WININFOCLASSNAME else if (AMenuItem = MenuItem_Copy_WinInfoText) then Result := G_ciIDM_COPY_WININFOTEXT else if (AMenuItem = MenuItem_Copy_WinInfoWindowSize) then Result := G_ciIDM_COPY_WININFOWINDOWSIZE else if (AMenuItem = MenuItem_Copy_WinInfoWindowSizeLeft) then Result := G_ciIDM_COPY_WININFOWINDOWSIZE_LEFT else if (AMenuItem = MenuItem_Copy_WinInfoWindowSizeTop) then Result := G_ciIDM_COPY_WININFOWINDOWSIZE_TOP else if (AMenuItem = MenuItem_Copy_WinInfoWindowSizeWidth) then Result := G_ciIDM_COPY_WININFOWINDOWSIZE_WIDTH else if (AMenuItem = MenuItem_Copy_WinInfoWindowSizeHeight) then Result := G_ciIDM_COPY_WININFOWINDOWSIZE_HEIGHT else if (AMenuItem = MenuItem_Copy_WinInfoClientSize) then Result := G_ciIDM_COPY_WININFOCLIENTSIZE else if (AMenuItem = MenuItem_Copy_WinInfoClientSizeWidth) then Result := G_ciIDM_COPY_WININFOCLIENTSIZE_WIDTH else if (AMenuItem = MenuItem_Copy_WinInfoClientSizeHeight) then Result := G_ciIDM_COPY_WININFOCLIENTSIZE_HEIGHT else if (AMenuItem = MenuItem_Copy_WinInfoRect) then Result := G_ciIDM_COPY_WININFORECT else if (AMenuItem = MenuItem_Copy_WinInfoRectLeft) then Result := G_ciIDM_COPY_WININFORECT_LEFT else if (AMenuItem = MenuItem_Copy_WinInfoRectTop) then Result := G_ciIDM_COPY_WININFORECT_TOP else if (AMenuItem = MenuItem_Copy_WinInfoRectRight) then Result := G_ciIDM_COPY_WININFORECT_RIGHT else if (AMenuItem = MenuItem_Copy_WinInfoRectBottom) then Result := G_ciIDM_COPY_WININFORECT_BOTTOM else if (AMenuItem = MenuItem_Copy_WinInfoControlID) then Result := G_ciIDM_COPY_WININFOCONTROLID else if (AMenuItem = MenuItem_Copy_WinInfoStyle) then Result := G_ciIDM_COPY_WININFOSTYLE else if (AMenuItem = MenuItem_Copy_WinInfoStyleEx) then Result := G_ciIDM_COPY_WININFOSTYLEEX else if (AMenuItem = MenuItem_Copy_WinInfoPID) then Result := G_ciIDM_COPY_WININFOPID else if (AMenuItem = MenuItem_Copy_WinInfoExeName) then Result := G_ciIDM_COPY_WININFOEXENAME else if (AMenuItem = MenuItem_Copy_WinInfoFileVersion) then Result := G_ciIDM_COPY_WININFOFILEVERSION // else if (AMenuItem = MenuItem_Copy_WinInfoStyleVerbose) then Result := G_ciIDM_COPY_WININFOSTYLEVERBOSE else if (AMenuItem = MenuItem_Copy_Line4) then Result := G_ciIDM_COPY_LINE4 else if (AMenuItem = MenuItem_Copy_All) then Result := G_ciIDM_COPY_ALL // else if (AMenuItem = MenuItem_Copy_Line5) then Result := G_ciIDM_COPY_LINE5 // else if (AMenuItem = MenuItem_Copy_OptUnicode) then Result := G_ciIDM_COPY_OPT_UNICODE //[テキスト書き換え] else if (AMenuItem = MenuItem_Write) then Result := G_ciIDM_WRITE else if (AMenuItem = MenuItem_Write_InfoCash) then Result := G_ciIDM_WRITE_INFOCASH else if (AMenuItem = MenuItem_Write_ClearCash) then Result := G_ciIDM_WRITE_CLEARCASH else if (AMenuItem = MenuItem_Write_ClipboardText) then Result := G_ciIDM_WRITE_CLIPBOARD else if (AMenuItem = MenuItem_Write_TextClear) then Result := G_ciIDM_WRITE_TEXTCLEAR else if (AMenuItem = MenuItem_Write_Line1) then Result := G_ciIDM_WRITE_LINE1 else if (AMenuItem = MenuItem_Write_ColorRGB) then Result := G_ciIDM_WRITE_COLORRGB else if (AMenuItem = MenuItem_Write_ColorRGBRed) then Result := G_ciIDM_WRITE_COLORRGBRED else if (AMenuItem = MenuItem_Write_ColorRGBGreen) then Result := G_ciIDM_WRITE_COLORRGBGREEN else if (AMenuItem = MenuItem_Write_ColorRGBBlue) then Result := G_ciIDM_WRITE_COLORRGBBLUE else if (AMenuItem = MenuItem_Write_ColorHTML) then Result := G_ciIDM_WRITE_COLORHTML else if (AMenuItem = MenuItem_Write_ColorCOLORREF) then Result := G_ciIDM_WRITE_COLORCOLORREF else if (AMenuItem = MenuItem_Write_ColorHSV) then Result := G_ciIDM_WRITE_COLORHSV else if (AMenuItem = MenuItem_Write_ColorHSVHue) then Result := G_ciIDM_WRITE_COLORHSVHUE else if (AMenuItem = MenuItem_Write_ColorHSVSaturation) then Result := G_ciIDM_WRITE_COLORHSVSATURATION else if (AMenuItem = MenuItem_Write_ColorHSVValue) then Result := G_ciIDM_WRITE_COLORHSVVALUE else if (AMenuItem = MenuItem_Write_ColorHLS) then Result := G_ciIDM_WRITE_COLORHLS else if (AMenuItem = MenuItem_Write_ColorHLSHue) then Result := G_ciIDM_WRITE_COLORHLSHUE else if (AMenuItem = MenuItem_Write_ColorHLSSaturation) then Result := G_ciIDM_WRITE_COLORHLSSATURATION else if (AMenuItem = MenuItem_Write_ColorHLSLightness) then Result := G_ciIDM_WRITE_COLORHLSLIGHTNESS else if (AMenuItem = MenuItem_Write_ColorHLSWin) then Result := G_ciIDM_WRITE_COLORHLSWIN else if (AMenuItem = MenuItem_Write_ColorHLSWinHue) then Result := G_ciIDM_WRITE_COLORHLSWINHUE else if (AMenuItem = MenuItem_Write_ColorHLSWinSaturation) then Result := G_ciIDM_WRITE_COLORHLSWINSATURATION else if (AMenuItem = MenuItem_Write_ColorHLSWinLightness) then Result := G_ciIDM_WRITE_COLORHLSWINLIGHTNESS else if (AMenuItem = MenuItem_Write_Line2) then Result := G_ciIDM_WRITE_LINE2 else if (AMenuItem = MenuItem_Write_PosScreen) then Result := G_ciIDM_WRITE_POSSCREEN else if (AMenuItem = MenuItem_Write_PosScreenX) then Result := G_ciIDM_WRITE_POSSCREEN_X else if (AMenuItem = MenuItem_Write_PosScreenY) then Result := G_ciIDM_WRITE_POSSCREEN_Y else if (AMenuItem = MenuItem_Write_PosMonitor) then Result := G_ciIDM_WRITE_POSMONITOR else if (AMenuItem = MenuItem_Write_PosMonitorX) then Result := G_ciIDM_WRITE_POSMONITOR_X else if (AMenuItem = MenuItem_Write_PosMonitorY) then Result := G_ciIDM_WRITE_POSMONITOR_Y else if (AMenuItem = MenuItem_Write_PosClient) then Result := G_ciIDM_WRITE_POSCLIENT else if (AMenuItem = MenuItem_Write_PosClientX) then Result := G_ciIDM_WRITE_POSCLIENT_X else if (AMenuItem = MenuItem_Write_PosClientY) then Result := G_ciIDM_WRITE_POSCLIENT_Y else if (AMenuItem = MenuItem_Write_PosUser) then Result := G_ciIDM_WRITE_POSUSER else if (AMenuItem = MenuItem_Write_PosUserWidth) then Result := G_ciIDM_WRITE_POSUSER_WIDTH else if (AMenuItem = MenuItem_Write_PosUserHeight) then Result := G_ciIDM_WRITE_POSUSER_HEIGHT else if (AMenuItem = MenuItem_Write_Line3) then Result := G_ciIDM_WRITE_LINE3 else if (AMenuItem = MenuItem_Write_WinInfoHandle) then Result := G_ciIDM_WRITE_WININFOHANDLE else if (AMenuItem = MenuItem_Write_WinInfoClassName) then Result := G_ciIDM_WRITE_WININFOCLASSNAME else if (AMenuItem = MenuItem_Write_WinInfoText) then Result := G_ciIDM_WRITE_WININFOTEXT else if (AMenuItem = MenuItem_Write_WinInfoWindowSize) then Result := G_ciIDM_WRITE_WININFOWINDOWSIZE else if (AMenuItem = MenuItem_Write_WinInfoWindowSizeLeft) then Result := G_ciIDM_WRITE_WININFOWINDOWSIZE_LEFT else if (AMenuItem = MenuItem_Write_WinInfoWindowSizeTop) then Result := G_ciIDM_WRITE_WININFOWINDOWSIZE_TOP else if (AMenuItem = MenuItem_Write_WinInfoWindowSizeWidth) then Result := G_ciIDM_WRITE_WININFOWINDOWSIZE_WIDTH else if (AMenuItem = MenuItem_Write_WinInfoWindowSizeHeight) then Result := G_ciIDM_WRITE_WININFOWINDOWSIZE_HEIGHT else if (AMenuItem = MenuItem_Write_WinInfoClientSize) then Result := G_ciIDM_WRITE_WININFOCLIENTSIZE else if (AMenuItem = MenuItem_Write_WinInfoClientSizeWidth) then Result := G_ciIDM_WRITE_WININFOCLIENTSIZE_WIDTH else if (AMenuItem = MenuItem_Write_WinInfoClientSizeHeight) then Result := G_ciIDM_WRITE_WININFOCLIENTSIZE_HEIGHT else if (AMenuItem = MenuItem_Write_WinInfoRect) then Result := G_ciIDM_WRITE_WININFORECT else if (AMenuItem = MenuItem_Write_WinInfoRectLeft) then Result := G_ciIDM_WRITE_WININFORECT_LEFT else if (AMenuItem = MenuItem_Write_WinInfoRectTop) then Result := G_ciIDM_WRITE_WININFORECT_TOP else if (AMenuItem = MenuItem_Write_WinInfoRectRight) then Result := G_ciIDM_WRITE_WININFORECT_RIGHT else if (AMenuItem = MenuItem_Write_WinInfoRectBottom) then Result := G_ciIDM_WRITE_WININFORECT_BOTTOM else if (AMenuItem = MenuItem_Write_WinInfoControlID) then Result := G_ciIDM_WRITE_WININFOCONTROLID else if (AMenuItem = MenuItem_Write_WinInfoStyle) then Result := G_ciIDM_WRITE_WININFOSTYLE else if (AMenuItem = MenuItem_Write_WinInfoStyleEx) then Result := G_ciIDM_WRITE_WININFOSTYLEEX // else if (AMenuItem = MenuItem_Write_WinInfoStyleVerbose) then Result := G_ciIDM_WRITE_WININFOSTYLEVERBOSE else if (AMenuItem = MenuItem_Write_WinInfoPID) then Result := G_ciIDM_WRITE_WININFOPID else if (AMenuItem = MenuItem_Write_WinInfoExeName) then Result := G_ciIDM_WRITE_WININFOEXENAME else if (AMenuItem = MenuItem_Write_WinInfoFileVersion) then Result := G_ciIDM_WRITE_WININFOFILEVERSION //[キャプチャ] else if (AMenuItem = MenuItem_Capture) then Result := G_ciIDM_CAPTURE else if (AMenuItem = MenuItem_Capture_Pause) then Result := G_ciIDM_CAPTURE_PAUSE else if (AMenuItem = MenuItem_Capture_Update) then Result := G_ciIDM_CAPTURE_UPDATE else if (AMenuItem = MenuItem_Capture_Line1) then Result := G_ciIDM_CAPTURE_LINE1 else if (AMenuItem = MenuItem_Capture_Lupe) then Result := G_ciIDM_CAPTURE_LUPE else if (AMenuItem = MenuItem_Capture_Line2) then Result := G_ciIDM_CAPTURE_LINE2 else if (AMenuItem = MenuItem_Capture_NoSelfCapture) then Result := G_ciIDM_OPT_NOSELFCAPTURE else if (AMenuItem = MenuItem_Capture_SmoothCapture) then Result := G_ciIDM_OPT_SMOOTHCAPTURE else if (AMenuItem = MenuItem_Test_FlipNone) then Result := G_ciIDM_TEST_FLIPNONE else if (AMenuItem = MenuItem_Test_FlipHorizontal) then Result := G_ciIDM_TEST_FLIPHORIZONTAL else if (AMenuItem = MenuItem_Test_FlipVertical) then Result := G_ciIDM_TEST_FLIPVERTICAL else if (AMenuItem = MenuItem_Test_Rotate90) then Result := G_ciIDM_TEST_ROTATE90 else if (AMenuItem = MenuItem_Test_Rotate270) then Result := G_ciIDM_TEST_ROTATE270 else if (AMenuItem = MenuItem_Test_Rotate180) then Result := G_ciIDM_TEST_ROTATE180 //[オプション] else if (AMenuItem = MenuItem_Customize) then Result := G_ciIDM_CUSTOMIZE else if (AMenuItem = MenuItem_Opt_StayOnTop) then Result := G_ciIDM_OPT_STAYONTOP else if (AMenuItem = MenuItem_Opt_TitleBar) then Result := G_ciIDM_OPT_TITLEBAR else if (AMenuItem = MenuItem_Opt_ToolBar) then Result := G_ciIDM_OPT_TOOLBAR else if (AMenuItem = MenuItem_Opt_LargeIcon) then Result := G_ciIDM_OPT_LARGEICON else if (AMenuItem = MenuItem_Opt_ZoomWheel) then Result := G_ciIDM_OPT_ZOOMWHEEL else if (AMenuItem = MenuItem_Opt_LineTo) then Result := G_ciIDM_OPT_LINETO else if (AMenuItem = MenuItem_Opt_SelFont) then Result := G_ciIDM_OPT_FONTSIZE // else if (AMenuItem = MenuItem_Opt_SelBkColor) then Result := G_ciIDM_OPT_SELBKCOLOR else if (AMenuItem = MenuItem_Opt_Line1) then Result := G_ciIDM_OPT_LINE1 else if (AMenuItem = MenuItem_Test) then Result := G_ciIDM_TEST //暫定でコメントアウト // else if (AMenuItem = MenuItem_Test_DispAPITest) then Result := G_ciIDM_TEST_APITEST // else if (AMenuItem = MenuItem_Test_AeroThemeOnOff) then Result := G_ciIDM_TEST_AEROTHEMEONOFF else if (AMenuItem = MenuItem_Opt_Line2) then Result := G_ciIDM_OPT_LINE2 else if (AMenuItem = MenuItem_Customize_Setting) then Result := G_ciIDM_CUSTOMIZE_SETTING else if (AMenuItem = MenuItem_Customize_Menu) then Result := G_ciIDM_CUSTOMIZE_MENU else if (AMenuItem = MenuItem_Customize_ToolBar) then Result := G_ciIDM_CUSTOMIZE_TOOLBAR else if (AMenuItem = MenuItem_Customize_ShortCut) then Result := G_ciIDM_CUSTOMIZE_SHORTCUT else if (AMenuItem = MenuItem_Customize_Copy) then Result := G_ciIDM_CUSTOMIZE_COPY //[-] else if (AMenuItem = MenuItem_Main_Line3) then Result := G_ciIDM_MAIN_LINE3 //[バージョン情報] else if (AMenuItem = MenuItem_Help) then Result := G_ciIDM_HELP //[最小化] else if (AMenuItem = MenuItem_File_Minimize) then Result := G_ciIDM_FILE_MINIMIZE //[-] else if (AMenuItem = MenuItem_Main_Line4) then Result := G_ciIDM_MAIN_LINE4 //[終了] else if (AMenuItem = MenuItem_File_Exit) then Result := G_ciIDM_FILE_EXIT else begin Result := 0; end; end; function TApp_BugsEye.Get_CommandToAction(iCmd: Word): TAction; begin case iCmd of G_ciCMD_ZOOM_1 : Result := Action_Zoom_1; G_ciCMD_ZOOM_2 : Result := Action_Zoom_2; G_ciCMD_ZOOM_3 : Result := Action_Zoom_3; G_ciCMD_ZOOM_4 : Result := Action_Zoom_4; G_ciCMD_ZOOM_6 : Result := Action_Zoom_6; G_ciCMD_ZOOM_8 : Result := Action_Zoom_8; G_ciCMD_ZOOM_10 : Result := Action_Zoom_10; G_ciCMD_ZOOM_12 : Result := Action_Zoom_12; G_ciCMD_ZOOM_16 : Result := Action_Zoom_16; G_ciCMD_ZOOM_20 : Result := Action_Zoom_20; G_ciCMD_ZOOM_UP : Result := Action_Zoom_Up; G_ciCMD_ZOOM_DOWN : Result := Action_Zoom_Down; G_ciCMD_GRID_DISP : Result := Action_Grid_Disp; G_ciCMD_GRID_GRAY : Result := Action_Grid_Gray; G_ciCMD_GRID_BLACK : Result := Action_Grid_Black; G_ciCMD_GRID_WHITE : Result := Action_Grid_White; G_ciCMD_GRID_INVERT : Result := Action_Grid_Invert; G_ciCMD_GRID_TRANSPARENT : Result := Action_Grid_Transparent; G_ciCMD_GRID_SELCOLOR : Result := Action_Grid_SelColor; G_ciCMD_GRID_SUBNONE : Result := Action_Grid_SubNone; G_ciCMD_GRID_SUBBLUE : Result := Action_Grid_SubBlue; G_ciCMD_GRID_SUBRED : Result := Action_Grid_SubRed; G_ciCMD_GRID_SELSUBCOLOR : Result := Action_Grid_SelSubColor; G_ciCMD_GRID_USESUBELSECOLOR : Result := Action_Grid_UseSubElseColor; G_ciCMD_GRID_SELSUBELSECOLOR : Result := Action_Grid_SelSubElseColor; G_ciCMD_COLOR_RGB : Result := Action_Color_RGB; G_ciCMD_COLOR_HTML : Result := Action_Color_HTML; G_ciCMD_COLOR_COLORREF : Result := Action_Color_COLORREF; G_ciCMD_COLOR_HSV : Result := Action_Color_HSV; G_ciCMD_COLOR_HLS : Result := Action_Color_HLS; G_ciCMD_COLOR_HLSWIN : Result := Action_Color_HLSWin; G_ciCMD_COLOR_INFOONOFF : Result := Action_Color_InfoOnOff; G_ciCMD_POS_SCREEN : Result := Action_Pos_Screen; G_ciCMD_POS_MONITOR : Result := Action_Pos_Monitor; G_ciCMD_POS_CLIENT : Result := Action_Pos_Client; G_ciCMD_POS_LENGTH : Result := Action_Pos_Length; G_ciCMD_POS_LENGTHPOSSET : Result := Action_Pos_LengthPosSet; { G_ciCMD_POS_LOGICALSCREEN : Result := Action_Pos_LogicalScreen; G_ciCMD_POS_LOGICALMONITOR : Result := Action_Pos_LogicalMonitor; G_ciCMD_POS_LOGICALCLIENT : Result := Action_Pos_LogicalClient; G_ciCMD_POS_LOGICALLENGTH : Result := Action_Pos_LogicalLength; } G_ciCMD_POS_INFOONOFF : Result := Action_Pos_InfoOnOff; G_ciCMD_WININFO_HANDLE : Result := Action_WinInfo_Handle; G_ciCMD_WININFO_CLASSNAME : Result := Action_WinInfo_ClassName; G_ciCMD_WININFO_TEXT : Result := Action_WinInfo_Text; G_ciCMD_WININFO_WINDOWSIZE : Result := Action_WinInfo_WindowSize; G_ciCMD_WININFO_CLIENTSIZE : Result := Action_WinInfo_ClientSize; G_ciCMD_WININFO_RECT : Result := Action_WinInfo_Rect; G_ciCMD_WININFO_CONTROLID : Result := Action_WinInfo_ControlID; G_ciCMD_WININFO_STYLE : Result := Action_WinInfo_Style; G_ciCMD_WININFO_PARENTWINDOW : Result := Action_WinInfo_ParentWindow; G_ciCMD_WININFO_PID : Result := Action_WinInfo_PID; G_ciCMD_WININFO_EXENAME : Result := Action_WinInfo_ExeName; G_ciCMD_WININFO_FILEVERSION : Result := Action_WinInfo_FileVersion; G_ciCMD_WININFO_STYLEVERBOSE : Result := Action_WinInfo_StyleVerbose; G_ciCMD_WININFO_INFOONOFF : Result := Action_WinInfo_InfoOnOff; G_ciCMD_COPY_PICTURE : Result := Action_Copy_Picture; G_ciCMD_COPY_COLORRGB : Result := Action_Copy_ColorRGB; G_ciCMD_COPY_COLORRGBRED : Result := Action_Copy_ColorRGBRed; G_ciCMD_COPY_COLORRGBGREEN : Result := Action_Copy_ColorRGBGreen; G_ciCMD_COPY_COLORRGBBLUE : Result := Action_Copy_ColorRGBBlue; G_ciCMD_COPY_COLORHTML : Result := Action_Copy_ColorHTML; G_ciCMD_COPY_COLORCOLORREF : Result := Action_Copy_ColorCOLORREF; G_ciCMD_COPY_COLORHSV : Result := Action_Copy_ColorHSV; G_ciCMD_COPY_COLORHSVHUE : Result := Action_Copy_ColorHSVHue; G_ciCMD_COPY_COLORHSVSATURATION : Result := Action_Copy_ColorHSVSaturation; G_ciCMD_COPY_COLORHSVVALUE : Result := Action_Copy_ColorHSVValue; G_ciCMD_COPY_COLORHLS : Result := Action_Copy_ColorHLS; G_ciCMD_COPY_COLORHLSHUE : Result := Action_Copy_ColorHLSHue; G_ciCMD_COPY_COLORHLSSATURATION : Result := Action_Copy_ColorHLSSaturation; G_ciCMD_COPY_COLORHLSLIGHTNESS : Result := Action_Copy_ColorHLSLightness; G_ciCMD_COPY_COLORHLSWIN : Result := Action_Copy_ColorHLSWin; G_ciCMD_COPY_COLORHLSWINHUE : Result := Action_Copy_ColorHLSWinHue; G_ciCMD_COPY_COLORHLSWINSATURATION : Result := Action_Copy_ColorHLSWinSaturation; G_ciCMD_COPY_COLORHLSWINLIGHTNESS : Result := Action_Copy_ColorHLSWinLightness; G_ciCMD_COPY_POSSCREEN : Result := Action_Copy_PosScreen; G_ciCMD_COPY_POSSCREEN_X : Result := Action_Copy_PosScreenX; G_ciCMD_COPY_POSSCREEN_Y : Result := Action_Copy_PosScreenY; G_ciCMD_COPY_POSMONITOR : Result := Action_Copy_PosMonitor; G_ciCMD_COPY_POSMONITOR_X : Result := Action_Copy_PosMonitorX; G_ciCMD_COPY_POSMONITOR_Y : Result := Action_Copy_PosMonitorY; G_ciCMD_COPY_POSCLIENT : Result := Action_Copy_PosClient; G_ciCMD_COPY_POSCLIENT_X : Result := Action_Copy_PosClientX; G_ciCMD_COPY_POSCLIENT_Y : Result := Action_Copy_PosClientY; G_ciCMD_COPY_POSLENGTH : Result := Action_Copy_PosLength; G_ciCMD_COPY_POSLENGTH_WIDTH : Result := Action_Copy_PosLengthWidth; G_ciCMD_COPY_POSLENGTH_HEIGHT : Result := Action_Copy_PosLengthHeight; G_ciCMD_COPY_WININFOHANDLE : Result := Action_Copy_WinInfoHandle; G_ciCMD_COPY_WININFOCLASSNAME : Result := Action_Copy_WinInfoClassName; G_ciCMD_COPY_WININFOTEXT : Result := Action_Copy_WinInfoText; G_ciCMD_COPY_WININFOWINDOWSIZE : Result := Action_Copy_WinInfoWindowSize; G_ciCMD_COPY_WININFOWINDOWSIZE_LEFT : Result := Action_Copy_WinInfoWindowSizeLeft; G_ciCMD_COPY_WININFOWINDOWSIZE_TOP : Result := Action_Copy_WinInfoWindowSizeTop; G_ciCMD_COPY_WININFOWINDOWSIZE_WIDTH : Result := Action_Copy_WinInfoWindowSizeWidth; G_ciCMD_COPY_WININFOWINDOWSIZE_HEIGHT : Result := Action_Copy_WinInfoWindowSizeHeight; G_ciCMD_COPY_WININFOCLIENTSIZE : Result := Action_Copy_WinInfoClientSize; G_ciCMD_COPY_WININFOCLIENTSIZE_WIDTH : Result := Action_Copy_WinInfoClientSizeWidth; G_ciCMD_COPY_WININFOCLIENTSIZE_HEIGHT : Result := Action_Copy_WinInfoClientSizeHeight; G_ciCMD_COPY_WININFORECT : Result := Action_Copy_WinInfoRect; G_ciCMD_COPY_WININFORECT_LEFT : Result := Action_Copy_WinInfoRectLeft; G_ciCMD_COPY_WININFORECT_TOP : Result := Action_Copy_WinInfoRectTop; G_ciCMD_COPY_WININFORECT_RIGHT : Result := Action_Copy_WinInfoRectRight; G_ciCMD_COPY_WININFORECT_BOTTOM : Result := Action_Copy_WinInfoRectBottom; G_ciCMD_COPY_WININFOCONTROLID : Result := Action_Copy_WinInfoControlID; G_ciCMD_COPY_WININFOSTYLE : Result := Action_Copy_WinInfoStyle; G_ciCMD_COPY_WININFOSTYLEEX : Result := Action_Copy_WinInfoStyleEx; G_ciCMD_COPY_WININFOSTYLEVERBOSE : Result := Action_Copy_WinInfoStyleVerbose; G_ciCMD_COPY_WININFOPID : Result := Action_Copy_WinInfoPID; G_ciCMD_COPY_WININFOEXENAME : Result := Action_Copy_WinInfoExeName; G_ciCMD_COPY_WININFOFILEVERSION : Result := Action_Copy_WinInfoFileVersion; G_ciCMD_COPY_ALL : Result := Action_Copy_All; // G_ciCMD_COPY_OPTUNICODE : Result := Action_Copy_OptUnicode; //[テキスト書き換え] G_ciCMD_WRITE_INFOCASH : Result := Action_Write_InfoCash; G_ciCMD_WRITE_CLEARCASH : Result := Action_Write_ClearCash; G_ciCMD_WRITE_CLIPBOARD : Result := Action_Write_ClipboardText; G_ciCMD_WRITE_TEXTCLEAR : Result := Action_Write_TextClear; G_ciCMD_WRITE_COLORRGB : Result := Action_Write_ColorRGB; G_ciCMD_WRITE_COLORRGBRED : Result := Action_Write_ColorRGBRed; G_ciCMD_WRITE_COLORRGBGREEN : Result := Action_Write_ColorRGBGreen; G_ciCMD_WRITE_COLORRGBBLUE : Result := Action_Write_ColorRGBBlue; G_ciCMD_WRITE_COLORHTML : Result := Action_Write_ColorHTML; G_ciCMD_WRITE_COLORCOLORREF : Result := Action_Write_ColorCOLORREF; G_ciCMD_WRITE_COLORHSV : Result := Action_Write_ColorHSV; G_ciCMD_WRITE_COLORHSVHUE : Result := Action_Write_ColorHSVHUE; G_ciCMD_WRITE_COLORHSVSATURATION : Result := Action_Write_ColorHSVSATURATION; G_ciCMD_WRITE_COLORHSVVALUE : Result := Action_Write_ColorHSVVALUE; G_ciCMD_WRITE_COLORHLS : Result := Action_Write_ColorHLS; G_ciCMD_WRITE_COLORHLSHUE : Result := Action_Write_ColorHLSHUE; G_ciCMD_WRITE_COLORHLSSATURATION : Result := Action_Write_ColorHLSSATURATION; G_ciCMD_WRITE_COLORHLSLIGHTNESS : Result := Action_Write_ColorHLSLIGHTNESS; G_ciCMD_WRITE_COLORHLSWIN : Result := Action_Write_ColorHLSWIN; G_ciCMD_WRITE_COLORHLSWINHUE : Result := Action_Write_ColorHLSWINHUE; G_ciCMD_WRITE_COLORHLSWINSATURATION : Result := Action_Write_ColorHLSWINSATURATION; G_ciCMD_WRITE_COLORHLSWINLIGHTNESS : Result := Action_Write_ColorHLSWINLIGHTNESS; G_ciCMD_WRITE_POSSCREEN : Result := Action_Write_PosScreen; G_ciCMD_WRITE_POSSCREEN_X : Result := Action_Write_PosScreenX; G_ciCMD_WRITE_POSSCREEN_Y : Result := Action_Write_PosScreenY; G_ciCMD_WRITE_POSMONITOR : Result := Action_Write_PosMonitor; G_ciCMD_WRITE_POSMONITOR_X : Result := Action_Write_PosMonitorX; G_ciCMD_WRITE_POSMONITOR_Y : Result := Action_Write_PosMonitorY; G_ciCMD_WRITE_POSCLIENT : Result := Action_Write_PosClient; G_ciCMD_WRITE_POSCLIENT_X : Result := Action_Write_PosClientX; G_ciCMD_WRITE_POSCLIENT_Y : Result := Action_Write_PosClientY; G_ciCMD_WRITE_POSLENGTH : Result := Action_Write_PosLength; G_ciCMD_WRITE_POSLENGTH_WIDTH : Result := Action_Write_PosLengthWidth; G_ciCMD_WRITE_POSLENGTH_HEIGHT : Result := Action_Write_PosLengthHeight; G_ciCMD_WRITE_WININFOHANDLE : Result := Action_Write_WinInfoHandle; G_ciCMD_WRITE_WININFOCLASSNAME : Result := Action_Write_WinInfoClassName; G_ciCMD_WRITE_WININFOTEXT : Result := Action_Write_WinInfoText; G_ciCMD_WRITE_WININFOWINDOWSIZE : Result := Action_Write_WinInfoWindowSize; G_ciCMD_WRITE_WININFOWINDOWSIZE_LEFT : Result := Action_Write_WinInfoWindowSizeLeft; G_ciCMD_WRITE_WININFOWINDOWSIZE_TOP : Result := Action_Write_WinInfoWindowSizeTop; G_ciCMD_WRITE_WININFOWINDOWSIZE_WIDTH : Result := Action_Write_WinInfoWindowSizeWidth; G_ciCMD_WRITE_WININFOWINDOWSIZE_HEIGHT : Result := Action_Write_WinInfoWindowSizeHeight; G_ciCMD_WRITE_WININFOCLIENTSIZE : Result := Action_Write_WinInfoClientSize; G_ciCMD_WRITE_WININFOCLIENTSIZE_WIDTH : Result := Action_Write_WinInfoClientSizeWidth; G_ciCMD_WRITE_WININFOCLIENTSIZE_HEIGHT : Result := Action_Write_WinInfoClientSizeHeight; G_ciCMD_WRITE_WININFORECT : Result := Action_Write_WinInfoRect; G_ciCMD_WRITE_WININFORECT_LEFT : Result := Action_Write_WinInfoRectLeft; G_ciCMD_WRITE_WININFORECT_TOP : Result := Action_Write_WinInfoRectTop; G_ciCMD_WRITE_WININFORECT_RIGHT : Result := Action_Write_WinInfoRectRIGHT; G_ciCMD_WRITE_WININFORECT_BOTTOM : Result := Action_Write_WinInfoRectBOTTOM; G_ciCMD_WRITE_WININFOCONTROLID : Result := Action_Write_WinInfoControlID; G_ciCMD_WRITE_WININFOSTYLE : Result := Action_Write_WinInfoStyle; G_ciCMD_WRITE_WININFOSTYLEEX : Result := Action_Write_WinInfoStyleEx; // G_ciCMD_WRITE_WININFOSTYLEVERBOSE : Result := Action_Write_WinInfoStyleVerbose; G_ciCMD_WRITE_WININFOPID : Result := Action_Write_WinInfoPID; G_ciCMD_WRITE_WININFOEXENAME : Result := Action_Write_WinInfoExeName; G_ciCMD_WRITE_WININFOFILEVERSION : Result := Action_Write_WinInfoFileVersion; //[キャプチャ] G_ciCMD_CAPTURE_PAUSE : Result := Action_Capture_Pause; G_ciCMD_CAPTURE_LUPE : Result := Action_Capture_Lupe; G_ciCMD_CAPTURE_FIXED : Result := Action_Capture_Fixed; G_ciCMD_CAPTURE_UPDATE : Result := Action_Capture_Update; G_ciCMD_CAPTURE_DISP_X1 : Result := Action_Capture_Disp_x1; G_ciCMD_CAPTURE_MOVECURSORTOPOINT : Result := Action_Capture_MoveCursorToPoint; G_ciCMD_CAPTURE_POINTFROMCURSOR : Result := Action_Capture_PointFromCursor; G_ciCMD_TEST_FLIPNONE : Result := Action_Test_FlipNone; G_ciCMD_TEST_FLIPHORIZONTAL : Result := Action_Test_FlipHorizontal; G_ciCMD_TEST_FLIPVERTICAL : Result := Action_Test_FlipVertical; G_ciCMD_TEST_ROTATE90 : Result := Action_Test_Rotate90; G_ciCMD_TEST_ROTATE270 : Result := Action_Test_Rotate270; G_ciCMD_TEST_ROTATE180 : Result := Action_Test_Rotate180; //[オプション] G_ciCMD_OPT_STAYONTOP : Result := Action_Opt_StayOnTop; G_ciCMD_OPT_TITLEBAR : Result := Action_Opt_TitleBar; G_ciCMD_OPT_TOOLBAR : Result := Action_Opt_ToolBar; G_ciCMD_OPT_LARGEICON : Result := Action_Opt_LargeIcon; // G_ciCMD_OPT_BIGFONT : Result := Action_Opt_BigFont; G_ciCMD_OPT_ZOOMWHEEL : Result := Action_Opt_ZoomWheel; G_ciCMD_OPT_FONTSIZE : Result := Action_Opt_SelFont; G_ciCMD_OPT_LINETO : Result := Action_Opt_LineTo; //以下二つはオプションからキャプチャに移動したが互換性維持のためこのままにする。 G_ciCMD_OPT_NOSELFCAPTURE : Result := Action_Capture_NoSelfCapture; G_ciCMD_OPT_SMOOTHCAPTURE : Result := Action_Capture_SmoothCapture; G_ciCMD_TEST_APITEST : Result := Action_Test_APITest; G_ciCMD_TEST_AEROTHEMEONOFF : Result := Action_Test_AeroThemeOnOff; G_ciCMD_CUSTOM_SETTING : Result := Action_Custom_Setting; G_ciCMD_CUSTOM_MENU : Result := Action_Custom_Menu; G_ciCMD_CUSTOM_TOOLBAR : Result := Action_Custom_ToolBar; G_ciCMD_CUSTOM_SHORTCUT : Result := Action_Custom_ShortCut; G_ciCMD_CUSTOM_COPY : Result := Action_Custom_Copy; G_ciCMD_MENU_MAIN : Result := Action_Menu_Main; G_ciCMD_MENU_ZOOM : Result := Action_Menu_Zoom; G_ciCMD_MENU_GRID : Result := Action_Menu_Grid; G_ciCMD_MENU_COLOR : Result := Action_Menu_Color; G_ciCMD_MENU_POS : Result := Action_Menu_Pos; G_ciCMD_MENU_WININFO : Result := Action_Menu_WinInfo; G_ciCMD_MENU_COPY : Result := Action_Menu_Copy; G_ciCMD_MENU_CAPTURE : Result := Action_Menu_Capture; G_ciCMD_MENU_SETTING : Result := Action_Menu_Setting; G_ciCMD_MENU_TEST : Result := Action_Menu_Test; G_ciCMD_MOVE_MONITOR : Result := Action_Move_Monitor; G_ciCMD_MOVE_UP : Result := Action_Move_Up; G_ciCMD_MOVE_DOWN : Result := Action_Move_Down; G_ciCMD_MOVE_LEFT : Result := Action_Move_Left; G_ciCMD_MOVE_RIGHT : Result := Action_Move_Right; G_ciCMD_FILE_MINIMIZE : Result := Action_File_Minimize; G_ciCMD_FILE_EXIT : Result := Action_File_Exit; G_ciCMD_HELP : Result := Action_Help; else Result := nil; end; end; function TApp_BugsEye.Get_ActionToCommand(AAction: TAction): Word; begin if (AAction = Action_Zoom_1) then Result := G_ciCMD_ZOOM_1 else if (AAction = Action_Zoom_2) then Result := G_ciCMD_ZOOM_2 else if (AAction = Action_Zoom_3) then Result := G_ciCMD_ZOOM_3 else if (AAction = Action_Zoom_4) then Result := G_ciCMD_ZOOM_4 else if (AAction = Action_Zoom_6) then Result := G_ciCMD_ZOOM_6 else if (AAction = Action_Zoom_8) then Result := G_ciCMD_ZOOM_8 else if (AAction = Action_Zoom_10) then Result := G_ciCMD_ZOOM_10 else if (AAction = Action_Zoom_12) then Result := G_ciCMD_ZOOM_12 else if (AAction = Action_Zoom_16) then Result := G_ciCMD_ZOOM_16 else if (AAction = Action_Zoom_20) then Result := G_ciCMD_ZOOM_20 else if (AAction = Action_Zoom_Up) then Result := G_ciCMD_ZOOM_UP else if (AAction = Action_Zoom_Down) then Result := G_ciCMD_ZOOM_DOWN else if (AAction = Action_Grid_Disp) then Result := G_ciCMD_GRID_DISP else if (AAction = Action_Grid_Gray) then Result := G_ciCMD_GRID_GRAY else if (AAction = Action_Grid_Black) then Result := G_ciCMD_GRID_BLACK else if (AAction = Action_Grid_White) then Result := G_ciCMD_GRID_WHITE else if (AAction = Action_Grid_Invert) then Result := G_ciCMD_GRID_INVERT else if (AAction = Action_Grid_Transparent) then Result := G_ciCMD_GRID_TRANSPARENT else if (AAction = Action_Grid_SelColor) then Result := G_ciCMD_GRID_SELCOLOR else if (AAction = Action_Grid_SubNone) then Result := G_ciCMD_GRID_SUBNONE else if (AAction = Action_Grid_SubBlue) then Result := G_ciCMD_GRID_SUBBLUE else if (AAction = Action_Grid_SubRed) then Result := G_ciCMD_GRID_SUBRED else if (AAction = Action_Grid_SelSubColor) then Result := G_ciCMD_GRID_SELSUBCOLOR else if (AAction = Action_Grid_UseSubElseColor) then Result := G_ciCMD_GRID_USESUBELSECOLOR else if (AAction = Action_Grid_SelSubElseColor) then Result := G_ciCMD_GRID_SELSUBELSECOLOR else if (AAction = Action_Color_RGB) then Result := G_ciCMD_COLOR_RGB else if (AAction = Action_Color_HTML) then Result := G_ciCMD_COLOR_HTML else if (AAction = Action_Color_COLORREF) then Result := G_ciCMD_COLOR_COLORREF else if (AAction = Action_Color_HSV) then Result := G_ciCMD_COLOR_HSV else if (AAction = Action_Color_HLS) then Result := G_ciCMD_COLOR_HLS else if (AAction = Action_Color_HLSWin) then Result := G_ciCMD_COLOR_HLSWIN else if (AAction = Action_Color_InfoOnOff) then Result := G_ciCMD_COLOR_INFOONOFF else if (AAction = Action_Pos_Screen) then Result := G_ciCMD_POS_SCREEN else if (AAction = Action_Pos_Monitor) then Result := G_ciCMD_POS_MONITOR else if (AAction = Action_Pos_Client) then Result := G_ciCMD_POS_CLIENT else if (AAction = Action_Pos_Length) then Result := G_ciCMD_POS_LENGTH else if (AAction = Action_Pos_LengthPosSet) then Result := G_ciCMD_POS_LENGTHPOSSET { else if (AAction = Action_Pos_LogicalScreen) then Result := G_ciCMD_POS_LOGICALSCREEN else if (AAction = Action_Pos_LogicalMonitor) then Result := G_ciCMD_POS_LOGICALMONITOR else if (AAction = Action_Pos_LogicalClient) then Result := G_ciCMD_POS_LOGICALCLIENT else if (AAction = Action_Pos_LogicalLength) then Result := G_ciCMD_POS_LOGICALLENGTH } else if (AAction = Action_Pos_InfoOnOff) then Result := G_ciCMD_POS_INFOONOFF else if (AAction = Action_WinInfo_Handle) then Result := G_ciCMD_WININFO_HANDLE else if (AAction = Action_WinInfo_ClassName) then Result := G_ciCMD_WININFO_CLASSNAME else if (AAction = Action_WinInfo_Text) then Result := G_ciCMD_WININFO_TEXT else if (AAction = Action_WinInfo_WindowSize) then Result := G_ciCMD_WININFO_WINDOWSIZE else if (AAction = Action_WinInfo_ClientSize) then Result := G_ciCMD_WININFO_CLIENTSIZE else if (AAction = Action_WinInfo_Rect) then Result := G_ciCMD_WININFO_RECT else if (AAction = Action_WinInfo_ControlID) then Result := G_ciCMD_WININFO_CONTROLID else if (AAction = Action_WinInfo_Style) then Result := G_ciCMD_WININFO_STYLE else if (AAction = Action_WinInfo_ParentWindow) then Result := G_ciCMD_WININFO_PARENTWINDOW else if (AAction = Action_WinInfo_PID) then Result := G_ciCMD_WININFO_PID else if (AAction = Action_WinInfo_ExeName) then Result := G_ciCMD_WININFO_EXENAME else if (AAction = Action_WinInfo_FileVersion) then Result := G_ciCMD_WININFO_FILEVERSION else if (AAction = Action_WinInfo_StyleVerbose) then Result := G_ciCMD_WININFO_STYLEVERBOSE else if (AAction = Action_WinInfo_InfoOnOff) then Result := G_ciCMD_WININFO_INFOONOFF else if (AAction = Action_Copy_Picture) then Result := G_ciCMD_COPY_PICTURE else if (AAction = Action_Copy_ColorRGB) then Result := G_ciCMD_COPY_COLORRGB else if (AAction = Action_Copy_ColorRGBRed) then Result := G_ciCMD_COPY_COLORRGBRED else if (AAction = Action_Copy_ColorRGBGreen) then Result := G_ciCMD_COPY_COLORRGBGREEN else if (AAction = Action_Copy_ColorRGBBlue) then Result := G_ciCMD_COPY_COLORRGBBLUE else if (AAction = Action_Copy_ColorHTML) then Result := G_ciCMD_COPY_COLORHTML else if (AAction = Action_Copy_ColorCOLORREF) then Result := G_ciCMD_COPY_COLORCOLORREF else if (AAction = Action_Copy_ColorHSV) then Result := G_ciCMD_COPY_COLORHSV else if (AAction = Action_Copy_ColorHSVHue) then Result := G_ciCMD_COPY_COLORHSVHUE else if (AAction = Action_Copy_ColorHSVSaturation) then Result := G_ciCMD_COPY_COLORHSVSATURATION else if (AAction = Action_Copy_ColorHSVValue) then Result := G_ciCMD_COPY_COLORHSVVALUE else if (AAction = Action_Copy_ColorHLS) then Result := G_ciCMD_COPY_COLORHLS else if (AAction = Action_Copy_ColorHLSHue) then Result := G_ciCMD_COPY_COLORHLSHUE else if (AAction = Action_Copy_ColorHLSSaturation) then Result := G_ciCMD_COPY_COLORHLSSATURATION else if (AAction = Action_Copy_ColorHLSLightness) then Result := G_ciCMD_COPY_COLORHLSLIGHTNESS else if (AAction = Action_Copy_ColorHLSWin) then Result := G_ciCMD_COPY_COLORHLSWIN else if (AAction = Action_Copy_ColorHLSWinHue) then Result := G_ciCMD_COPY_COLORHLSWINHUE else if (AAction = Action_Copy_ColorHLSWinSaturation) then Result := G_ciCMD_COPY_COLORHLSWINSATURATION else if (AAction = Action_Copy_ColorHLSWinLightness) then Result := G_ciCMD_COPY_COLORHLSWINLIGHTNESS else if (AAction = Action_Copy_PosScreen) then Result := G_ciCMD_COPY_POSSCREEN else if (AAction = Action_Copy_PosScreenX) then Result := G_ciCMD_COPY_POSSCREEN_X else if (AAction = Action_Copy_PosScreenY) then Result := G_ciCMD_COPY_POSSCREEN_Y else if (AAction = Action_Copy_PosMonitor) then Result := G_ciCMD_COPY_POSMONITOR else if (AAction = Action_Copy_PosMonitorX) then Result := G_ciCMD_COPY_POSMONITOR_X else if (AAction = Action_Copy_PosMonitorY) then Result := G_ciCMD_COPY_POSMONITOR_Y else if (AAction = Action_Copy_PosClient) then Result := G_ciCMD_COPY_POSCLIENT else if (AAction = Action_Copy_PosClientX) then Result := G_ciCMD_COPY_POSCLIENT_X else if (AAction = Action_Copy_PosClientY) then Result := G_ciCMD_COPY_POSCLIENT_Y else if (AAction = Action_Copy_PosLength) then Result := G_ciCMD_COPY_POSLENGTH else if (AAction = Action_Copy_PosLengthWidth) then Result := G_ciCMD_COPY_POSLENGTH_WIDTH else if (AAction = Action_Copy_PosLengthHeight) then Result := G_ciCMD_COPY_POSLENGTH_HEIGHT else if (AAction = Action_Copy_WinInfoHandle) then Result := G_ciCMD_COPY_WININFOHANDLE else if (AAction = Action_Copy_WinInfoClassName) then Result := G_ciCMD_COPY_WININFOCLASSNAME else if (AAction = Action_Copy_WinInfoText) then Result := G_ciCMD_COPY_WININFOTEXT else if (AAction = Action_Copy_WinInfoWindowSize) then Result := G_ciCMD_COPY_WININFOWINDOWSIZE else if (AAction = Action_Copy_WinInfoWindowSizeLeft) then Result := G_ciCMD_COPY_WININFOWINDOWSIZE_LEFT else if (AAction = Action_Copy_WinInfoWindowSizeTop) then Result := G_ciCMD_COPY_WININFOWINDOWSIZE_TOP else if (AAction = Action_Copy_WinInfoWindowSizeWidth) then Result := G_ciCMD_COPY_WININFOWINDOWSIZE_WIDTH else if (AAction = Action_Copy_WinInfoWindowSizeHeight) then Result := G_ciCMD_COPY_WININFOWINDOWSIZE_HEIGHT else if (AAction = Action_Copy_WinInfoClientSize) then Result := G_ciCMD_COPY_WININFOCLIENTSIZE else if (AAction = Action_Copy_WinInfoClientSizeWidth) then Result := G_ciCMD_COPY_WININFOCLIENTSIZE_WIDTH else if (AAction = Action_Copy_WinInfoClientSizeHeight) then Result := G_ciCMD_COPY_WININFOCLIENTSIZE_HEIGHT else if (AAction = Action_Copy_WinInfoRect) then Result := G_ciCMD_COPY_WININFORECT else if (AAction = Action_Copy_WinInfoRectLeft) then Result := G_ciCMD_COPY_WININFORECT_LEFT else if (AAction = Action_Copy_WinInfoRectTop) then Result := G_ciCMD_COPY_WININFORECT_TOP else if (AAction = Action_Copy_WinInfoRectRight) then Result := G_ciCMD_COPY_WININFORECT_RIGHT else if (AAction = Action_Copy_WinInfoRectBottom) then Result := G_ciCMD_COPY_WININFORECT_BOTTOM else if (AAction = Action_Copy_WinInfoControlID) then Result := G_ciCMD_COPY_WININFOCONTROLID else if (AAction = Action_Copy_WinInfoStyle) then Result := G_ciCMD_COPY_WININFOSTYLE else if (AAction = Action_Copy_WinInfoStyleEx) then Result := G_ciCMD_COPY_WININFOSTYLEEX else if (AAction = Action_Copy_WinInfoStyleVerbose) then Result := G_ciCMD_COPY_WININFOSTYLEVERBOSE else if (AAction = Action_Copy_WinInfoPID) then Result := G_ciCMD_COPY_WININFOPID else if (AAction = Action_Copy_WinInfoExeName) then Result := G_ciCMD_COPY_WININFOEXENAME else if (AAction = Action_Copy_WinInfoFileVersion) then Result := G_ciCMD_COPY_WININFOFILEVERSION else if (AAction = Action_Copy_All) then Result := G_ciCMD_COPY_ALL // else if (AAction = Action_Copy_OptUnicode) then Result := G_ciCMD_COPY_OPTUNICODE //[テキスト書き換え] else if (AAction = Action_Write_InfoCash) then Result := G_ciCMD_WRITE_INFOCASH else if (AAction = Action_Write_ClearCash) then Result := G_ciCMD_WRITE_CLEARCASH else if (AAction = Action_Write_ClipboardText) then Result := G_ciCMD_WRITE_CLIPBOARD else if (AAction = Action_Write_TextClear) then Result := G_ciCMD_WRITE_TEXTCLEAR else if (AAction = Action_Write_ColorRGB) then Result := G_ciCMD_WRITE_COLORRGB else if (AAction = Action_Write_ColorRGBRed) then Result := G_ciCMD_WRITE_COLORRGBRED else if (AAction = Action_Write_ColorRGBGreen) then Result := G_ciCMD_WRITE_COLORRGBGREEN else if (AAction = Action_Write_ColorRGBBlue) then Result := G_ciCMD_WRITE_COLORRGBBLUE else if (AAction = Action_Write_ColorHTML) then Result := G_ciCMD_WRITE_COLORHTML else if (AAction = Action_Write_ColorCOLORREF) then Result := G_ciCMD_WRITE_COLORCOLORREF else if (AAction = Action_Write_ColorHSV) then Result := G_ciCMD_WRITE_COLORHSV else if (AAction = Action_Write_ColorHSVHUE) then Result := G_ciCMD_WRITE_COLORHSVHUE else if (AAction = Action_Write_ColorHSVSATURATION) then Result := G_ciCMD_WRITE_COLORHSVSATURATION else if (AAction = Action_Write_ColorHSVVALUE) then Result := G_ciCMD_WRITE_COLORHSVVALUE else if (AAction = Action_Write_ColorHLS) then Result := G_ciCMD_WRITE_COLORHLS else if (AAction = Action_Write_ColorHLSHUE) then Result := G_ciCMD_WRITE_COLORHLSHUE else if (AAction = Action_Write_ColorHLSSATURATION) then Result := G_ciCMD_WRITE_COLORHLSSATURATION else if (AAction = Action_Write_ColorHLSLIGHTNESS) then Result := G_ciCMD_WRITE_COLORHLSLIGHTNESS else if (AAction = Action_Write_ColorHLSWIN) then Result := G_ciCMD_WRITE_COLORHLSWIN else if (AAction = Action_Write_ColorHLSWINHUE) then Result := G_ciCMD_WRITE_COLORHLSWINHUE else if (AAction = Action_Write_ColorHLSWINSATURATION) then Result := G_ciCMD_WRITE_COLORHLSWINSATURATION else if (AAction = Action_Write_ColorHLSWINLIGHTNESS) then Result := G_ciCMD_WRITE_COLORHLSWINLIGHTNESS else if (AAction = Action_Write_PosScreen) then Result := G_ciCMD_WRITE_POSSCREEN else if (AAction = Action_Write_PosScreenX) then Result := G_ciCMD_WRITE_POSSCREEN_X else if (AAction = Action_Write_PosScreenY) then Result := G_ciCMD_WRITE_POSSCREEN_Y else if (AAction = Action_Write_PosMonitor) then Result := G_ciCMD_WRITE_POSMONITOR else if (AAction = Action_Write_PosMonitorX) then Result := G_ciCMD_WRITE_POSMONITOR_X else if (AAction = Action_Write_PosMonitorY) then Result := G_ciCMD_WRITE_POSMONITOR_Y else if (AAction = Action_Write_PosClient) then Result := G_ciCMD_WRITE_POSCLIENT else if (AAction = Action_Write_PosClientX) then Result := G_ciCMD_WRITE_POSCLIENT_X else if (AAction = Action_Write_PosClientY) then Result := G_ciCMD_WRITE_POSCLIENT_Y else if (AAction = Action_Write_PosLength) then Result := G_ciCMD_WRITE_POSLENGTH else if (AAction = Action_Write_PosLengthWidth) then Result := G_ciCMD_WRITE_POSLENGTH_WIDTH else if (AAction = Action_Write_PosLengthHeight) then Result := G_ciCMD_WRITE_POSLENGTH_HEIGHT else if (AAction = Action_Write_WinInfoHandle) then Result := G_ciCMD_WRITE_WININFOHANDLE else if (AAction = Action_Write_WinInfoClassName) then Result := G_ciCMD_WRITE_WININFOCLASSNAME else if (AAction = Action_Write_WinInfoText) then Result := G_ciCMD_WRITE_WININFOTEXT else if (AAction = Action_Write_WinInfoWindowSize) then Result := G_ciCMD_WRITE_WININFOWINDOWSIZE else if (AAction = Action_Write_WinInfoWindowSizeLeft) then Result := G_ciCMD_WRITE_WININFOWINDOWSIZE_LEFT else if (AAction = Action_Write_WinInfoWindowSizeTop) then Result := G_ciCMD_WRITE_WININFOWINDOWSIZE_TOP else if (AAction = Action_Write_WinInfoWindowSizeWidth) then Result := G_ciCMD_WRITE_WININFOWINDOWSIZE_WIDTH else if (AAction = Action_Write_WinInfoWindowSizeHeight) then Result := G_ciCMD_WRITE_WININFOWINDOWSIZE_HEIGHT else if (AAction = Action_Write_WinInfoClientSize) then Result := G_ciCMD_WRITE_WININFOCLIENTSIZE else if (AAction = Action_Write_WinInfoClientSizeWidth) then Result := G_ciCMD_WRITE_WININFOCLIENTSIZE_WIDTH else if (AAction = Action_Write_WinInfoClientSizeHeight) then Result := G_ciCMD_WRITE_WININFOCLIENTSIZE_HEIGHT else if (AAction = Action_Write_WinInfoRect) then Result := G_ciCMD_WRITE_WININFORECT else if (AAction = Action_Write_WinInfoRectLeft) then Result := G_ciCMD_WRITE_WININFORECT_LEFT else if (AAction = Action_Write_WinInfoRectTop) then Result := G_ciCMD_WRITE_WININFORECT_TOP else if (AAction = Action_Write_WinInfoRectRIGHT) then Result := G_ciCMD_WRITE_WININFORECT_RIGHT else if (AAction = Action_Write_WinInfoRectBOTTOM) then Result := G_ciCMD_WRITE_WININFORECT_BOTTOM else if (AAction = Action_Write_WinInfoControlID) then Result := G_ciCMD_WRITE_WININFOCONTROLID else if (AAction = Action_Write_WinInfoStyle) then Result := G_ciCMD_WRITE_WININFOSTYLE else if (AAction = Action_Write_WinInfoStyleEx) then Result := G_ciCMD_WRITE_WININFOSTYLEEX else if (AAction = Action_Write_WinInfoPID) then Result := G_ciCMD_WRITE_WININFOPID else if (AAction = Action_Write_WinInfoExeName) then Result := G_ciCMD_WRITE_WININFOEXENAME else if (AAction = Action_Write_WinInfoFileVersion) then Result := G_ciCMD_WRITE_WININFOFILEVERSION else if (AAction = Action_Capture_Pause) then Result := G_ciCMD_CAPTURE_PAUSE else if (AAction = Action_Capture_Lupe) then Result := G_ciCMD_CAPTURE_LUPE else if (AAction = Action_Capture_Fixed) then Result := G_ciCMD_CAPTURE_FIXED else if (AAction = Action_Capture_Update) then Result := G_ciCMD_CAPTURE_UPDATE else if (AAction = Action_Capture_Disp_x1) then Result := G_ciCMD_CAPTURE_DISP_X1 else if (AAction = Action_Capture_MoveCursorToPoint) then Result := G_ciCMD_CAPTURE_MOVECURSORTOPOINT else if (AAction = Action_Capture_PointFromCursor) then Result := G_ciCMD_CAPTURE_POINTFROMCURSOR else if (AAction = Action_Test_FlipNone) then Result := G_ciCMD_TEST_FLIPNONE else if (AAction = Action_Test_FlipHorizontal) then Result := G_ciCMD_TEST_FLIPHORIZONTAL else if (AAction = Action_Test_FlipVertical) then Result := G_ciCMD_TEST_FLIPVERTICAL else if (AAction = Action_Test_Rotate90) then Result := G_ciCMD_TEST_ROTATE90 else if (AAction = Action_Test_Rotate270) then Result := G_ciCMD_TEST_ROTATE270 else if (AAction = Action_Test_Rotate180) then Result := G_ciCMD_TEST_ROTATE180 //[オプション] else if (AAction = Action_Opt_StayOnTop) then Result := G_ciCMD_OPT_STAYONTOP else if (AAction = Action_Opt_TitleBar) then Result := G_ciCMD_OPT_TITLEBAR else if (AAction = Action_Opt_ToolBar) then Result := G_ciCMD_OPT_TOOLBAR else if (AAction = Action_Opt_LargeIcon) then Result := G_ciCMD_OPT_LARGEICON else if (AAction = Action_Opt_ZoomWheel) then Result := G_ciCMD_OPT_ZOOMWHEEL // else if (AAction = Action_Opt_SelBkColor) then Result := G_ciCMD_OPT_SELBKCOLOR else if (AAction = Action_Opt_LineTo) then Result := G_ciCMD_OPT_LINETO else if (AAction = Action_Opt_SelFont) then Result := G_ciCMD_OPT_FONTSIZE else if (AAction = Action_Test_APITest) then Result := G_ciCMD_TEST_APITEST else if (AAction = Action_Test_AeroThemeOnOff) then Result := G_ciCMD_TEST_AEROTHEMEONOFF //以下の二つはオプションからキャプチャに変更したが互換性維持のためこの位置のままにしておく。 else if (AAction = Action_Capture_NoSelfCapture) then Result := G_ciCMD_OPT_NOSELFCAPTURE else if (AAction = Action_Capture_SmoothCapture) then Result := G_ciCMD_OPT_SMOOTHCAPTURE else if (AAction = Action_Custom_Setting) then Result := G_ciCMD_CUSTOM_SETTING else if (AAction = Action_Custom_Menu) then Result := G_ciCMD_CUSTOM_MENU else if (AAction = Action_Custom_ToolBar) then Result := G_ciCMD_CUSTOM_TOOLBAR else if (AAction = Action_Custom_ShortCut) then Result := G_ciCMD_CUSTOM_SHORTCUT else if (AAction = Action_Custom_Copy) then Result := G_ciCMD_CUSTOM_COPY else if (AAction = Action_Menu_Main) then Result := G_ciCMD_MENU_MAIN else if (AAction = Action_Menu_Zoom) then Result := G_ciCMD_MENU_ZOOM else if (AAction = Action_Menu_Grid) then Result := G_ciCMD_MENU_GRID else if (AAction = Action_Menu_Color) then Result := G_ciCMD_MENU_COLOR else if (AAction = Action_Menu_Pos) then Result := G_ciCMD_MENU_POS else if (AAction = Action_Menu_WinInfo) then Result := G_ciCMD_MENU_WININFO else if (AAction = Action_Menu_Copy) then Result := G_ciCMD_MENU_COPY else if (AAction = Action_Menu_Capture) then Result := G_ciCMD_MENU_CAPTURE else if (AAction = Action_Menu_Setting) then Result := G_ciCMD_MENU_SETTING else if (AAction = Action_Menu_Test) then Result := G_ciCMD_MENU_TEST else if (AAction = Action_Move_Monitor) then Result := G_ciCMD_MOVE_MONITOR else if (AAction = Action_Move_Up) then Result := G_ciCMD_MOVE_UP else if (AAction = Action_Move_Down) then Result := G_ciCMD_MOVE_DOWN else if (AAction = Action_Move_Left) then Result := G_ciCMD_MOVE_LEFT else if (AAction = Action_Move_Right) then Result := G_ciCMD_MOVE_RIGHT else if (AAction = Action_File_Minimize) then Result := G_ciCMD_FILE_MINIMIZE else if (AAction = Action_File_Exit) then Result := G_ciCMD_FILE_EXIT else if (AAction = Action_Help) then Result := G_ciCMD_HELP else begin Result := 0; end; end; function TApp_BugsEye.Get_IDMToCopyIndex(iIDM: Word): Word; begin case iIDM of G_ciIDM_COPY_PICTURE : Result := G_ciFMTZOOM; G_ciIDM_COPY_COLORRGB : Result := G_ciFMTCOLOR_RGB; G_ciIDM_COPY_COLORRGBRED : Result := G_ciFMTCOLOR_RGBRED; G_ciIDM_COPY_COLORRGBGREEN : Result := G_ciFMTCOLOR_RGBGREEN; G_ciIDM_COPY_COLORRGBBLUE : Result := G_ciFMTCOLOR_RGBBLUE; G_ciIDM_COPY_COLORHTML : Result := G_ciFMTCOLOR_HTML; G_ciIDM_COPY_COLORCOLORREF : Result := G_ciFMTCOLOR_COLORREF; G_ciIDM_COPY_COLORHSV : Result := G_ciFMTCOLOR_HSV; G_ciIDM_COPY_COLORHSVHUE : Result := G_ciFMTCOLOR_HSVHUE; G_ciIDM_COPY_COLORHSVSATURATION : Result := G_ciFMTCOLOR_HSVSATURATION; G_ciIDM_COPY_COLORHSVVALUE : Result := G_ciFMTCOLOR_HSVVALUE; G_ciIDM_COPY_COLORHLS : Result := G_ciFMTCOLOR_HLS; G_ciIDM_COPY_COLORHLSHUE : Result := G_ciFMTCOLOR_HLSHUE; G_ciIDM_COPY_COLORHLSSATURATION : Result := G_ciFMTCOLOR_HLSSATURATION; G_ciIDM_COPY_COLORHLSLIGHTNESS : Result := G_ciFMTCOLOR_HLSLIGHTNESS; G_ciIDM_COPY_COLORHLSWIN : Result := G_ciFMTCOLOR_HLSWIN; G_ciIDM_COPY_COLORHLSWINHUE : Result := G_ciFMTCOLOR_HLSWINHUE; G_ciIDM_COPY_COLORHLSWINSATURATION : Result := G_ciFMTCOLOR_HLSWINSATURATION; G_ciIDM_COPY_COLORHLSWINLIGHTNESS : Result := G_ciFMTCOLOR_HLSWINLIGHTNESS; G_ciIDM_COPY_POSSCREEN : Result := G_ciFMTPOS_SCREEN; G_ciIDM_COPY_POSMONITOR : Result := G_ciFMTPOS_MONITOR; G_ciIDM_COPY_POSCLIENT : Result := G_ciFMTPOS_CLIENT; G_ciIDM_COPY_POSUSER : Result := G_ciFMTPOS_LENGTH; G_ciIDM_COPY_WININFOHANDLE : Result := G_ciFMTWININFO_HANDLE; G_ciIDM_COPY_WININFOCLASSNAME : Result := G_ciFMTWININFO_CLASSNAME; G_ciIDM_COPY_WININFOTEXT : Result := G_ciFMTWININFO_TEXT; G_ciIDM_COPY_WININFOWINDOWSIZE : Result := G_ciFMTWININFO_WINDOWSIZE; G_ciIDM_COPY_WININFOCLIENTSIZE : Result := G_ciFMTWININFO_CLIENTSIZE; G_ciIDM_COPY_WININFORECT : Result := G_ciFMTWININFO_RECT; G_ciIDM_COPY_WININFOCONTROLID : Result := G_ciFMTWININFO_CONTROLID; G_ciIDM_COPY_WININFOSTYLE : Result := G_ciFMTWININFO_STYLE; G_ciIDM_COPY_WININFOSTYLEEX : Result := G_ciFMTWININFO_STYLEEX; G_ciIDM_COPY_WININFOPID : Result := G_ciFMTWININFO_PID; G_ciIDM_COPY_WININFOEXENAME : Result := G_ciFMTWININFO_EXENAME; G_ciIDM_COPY_WININFOFILEVERSION : Result := G_ciFMTWININFO_FILEVERSION; else Result := High(Word); end; end; function TApp_BugsEye.Get_CopyIndexToIDM(iIndex: Word): Word; begin case iIndex of G_ciFMTZOOM : Result := G_ciIDM_COPY_PICTURE ; G_ciFMTCOLOR_RGB : Result := G_ciIDM_COPY_COLORRGB; G_ciFMTCOLOR_RGBRED : Result := G_ciIDM_COPY_COLORRGBRED; G_ciFMTCOLOR_RGBGREEN : Result := G_ciIDM_COPY_COLORRGBGREEN; G_ciFMTCOLOR_RGBBLUE : Result := G_ciIDM_COPY_COLORRGBBLUE; G_ciFMTCOLOR_HTML : Result := G_ciIDM_COPY_COLORHTML; G_ciFMTCOLOR_COLORREF : Result := G_ciIDM_COPY_COLORCOLORREF; G_ciFMTCOLOR_HSV : Result := G_ciIDM_COPY_COLORHSV; G_ciFMTCOLOR_HSVHUE : Result := G_ciIDM_COPY_COLORHSVHUE; G_ciFMTCOLOR_HSVSATURATION : Result := G_ciIDM_COPY_COLORHSVSATURATION; G_ciFMTCOLOR_HSVVALUE : Result := G_ciIDM_COPY_COLORHSVVALUE; G_ciFMTCOLOR_HLS : Result := G_ciIDM_COPY_COLORHLS; G_ciFMTCOLOR_HLSHUE : Result := G_ciIDM_COPY_COLORHLSHUE; G_ciFMTCOLOR_HLSSATURATION : Result := G_ciIDM_COPY_COLORHLSSATURATION; G_ciFMTCOLOR_HLSLIGHTNESS : Result := G_ciIDM_COPY_COLORHLSLIGHTNESS; G_ciFMTCOLOR_HLSWIN : Result := G_ciIDM_COPY_COLORHLSWIN; G_ciFMTCOLOR_HLSWINHUE : Result := G_ciIDM_COPY_COLORHLSWINHUE; G_ciFMTCOLOR_HLSWINSATURATION : Result := G_ciIDM_COPY_COLORHLSWINSATURATION; G_ciFMTCOLOR_HLSWINLIGHTNESS : Result := G_ciIDM_COPY_COLORHLSWINLIGHTNESS; G_ciFMTPOS_SCREEN : Result := G_ciIDM_COPY_POSSCREEN; G_ciFMTPOS_MONITOR : Result := G_ciIDM_COPY_POSMONITOR; G_ciFMTPOS_CLIENT : Result := G_ciIDM_COPY_POSCLIENT; G_ciFMTPOS_LENGTH : Result := G_ciIDM_COPY_POSUSER; G_ciFMTWININFO_HANDLE : Result := G_ciIDM_COPY_WININFOHANDLE; G_ciFMTWININFO_CLASSNAME : Result := G_ciIDM_COPY_WININFOCLASSNAME; G_ciFMTWININFO_TEXT : Result := G_ciIDM_COPY_WININFOTEXT; G_ciFMTWININFO_WINDOWSIZE : Result := G_ciIDM_COPY_WININFOWINDOWSIZE; G_ciFMTWININFO_CLIENTSIZE : Result := G_ciIDM_COPY_WININFOCLIENTSIZE; G_ciFMTWININFO_RECT : Result := G_ciIDM_COPY_WININFORECT; G_ciFMTWININFO_CONTROLID : Result := G_ciIDM_COPY_WININFOCONTROLID; G_ciFMTWININFO_STYLE : Result := G_ciIDM_COPY_WININFOSTYLE; G_ciFMTWININFO_STYLEEX : Result := G_ciIDM_COPY_WININFOSTYLEEX; G_ciFMTWININFO_PID : Result := G_ciIDM_COPY_WININFOPID; G_ciFMTWININFO_EXENAME : Result := G_ciIDM_COPY_WININFOEXENAME; G_ciFMTWININFO_FILEVERSION : Result := G_ciIDM_COPY_WININFOFILEVERSION; else Result := High(Word); end; end; function TApp_BugsEye.FLoadBin: Boolean; var i, k : Integer; li_Left : Integer; li_Top : Integer; li_Width : Integer; li_Height : Integer; l_Action : TAction; begin //[Copy] for i := 0 to G_ciFMTCOUNT do begin //初期値をセット FSetCopyFmt(i, FGetInitCopyFmt(i)); end; Result := False; //Shift+Ctrl起動で設定を読み込まない。AIU if (gfnbKeyState(VK_SHIFT) and gfnbKeyState(VK_CONTROL)) then begin Exit; end; Result := G_fnbSettingRead; //(lr_SettingInfo, lr_ShortCutKeys, lr_MouseGesture); if not(Result) then begin Exit; end; with G_rSettingInfo do begin //[Zoom] //倍率の設定は最初にやっておく FiZoomIndex := gfniNumLimit(iZoomIndex, 0, MenuItem_Zoom.Count -1); Action_ZoomExecute(MenuItem_Zoom.Items[FiZoomIndex].Action); //[Grid] //Action_Grid_DispExecuteを呼ばないのでnotで反転させる必要はない Action_Grid_Disp.Checked := (iGridFlag and G_ciFLG_GRID_DISP) = G_ciFLG_GRID_DISP; Action_Grid_UseSubElseColor.Checked := (iGridFlag and G_ciFLG_GRID_ELSECOLOR) = G_ciFLG_GRID_ELSECOLOR; Action_Grid_SelColor.Tag := clGridColor; Action_Grid_SelSubColor.Tag := clSubGridColor; Action_Grid_SelSubElseColor.Tag := clSubGridElseColor; //グリッド色 TAction(MenuItem_Grid.Items[iGridIndex].Action).Checked := True; Action_Grid_ColorExecute(MenuItem_Grid.Items[iGridIndex].Action); //サブグリッド色 iSubGridIndex := iSubGridIndex + (MenuItem_Grid_LineSubGrid.MenuIndex +1); TAction(MenuItem_Grid.Items[iSubGridIndex].Action).Checked := True; Action_Grid_SubColorExecute(MenuItem_Grid.Items[iSubGridIndex].Action); //サブグリッド2色目 Action_Grid_UseSubElseColorExecute(nil); //[Color] Action_Color_RGB.Checked := gfnbFlagCheck(iColorFlag, G_ciFLG_COLOR_RGB); Action_Color_HTML.Checked := gfnbFlagCheck(iColorFlag, G_ciFLG_COLOR_HTML); Action_Color_COLORREF.Checked := gfnbFlagCheck(iColorFlag, G_ciFLG_COLOR_COLORREF); Action_Color_HSV.Checked := gfnbFlagCheck(iColorFlag, G_ciFLG_COLOR_HSV); Action_Color_HLS.Checked := gfnbFlagCheck(iColorFlag, G_ciFLG_COLOR_HLS); Action_Color_HLSWin.Checked := gfnbFlagCheck(iColorFlag, G_ciFLG_COLOR_HLSWin); //[Position] Action_Pos_Screen.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_SCREEN); Action_Pos_Monitor.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_MONITOR); Action_Pos_Client.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_CLIENT); Action_Pos_Length.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_LENGTH); { Action_Pos_LogicalScreen.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_LOGICALSCREEN); Action_Pos_LogicalMonitor.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_LOGICALMONITOR); Action_Pos_LogicalClient.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_LOGICALCLIENT); Action_Pos_LogicalLength.Checked := gfnbFlagCheck(iPosFlag, G_ciFLG_POS_LOGICALLENGTH); } FrDispInfo.ptLengthPos.X := gfniNumLimit(ptLengthPos.X, 0, MyScreenSize.ScreenWidth); FrDispInfo.ptLengthPos.Y := gfniNumLimit(ptLengthPos.Y, 0, MyScreenSize.ScreenHeight); //[WindowInfo] Action_WinInfo_Handle.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_HANDLE); Action_WinInfo_ClassName.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_CLASSNAME); Action_WinInfo_Text.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_TEXT); Action_WinInfo_WindowSize.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_WINDOWSIZE); Action_WinInfo_ClientSize.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_CLIENTSIZE); Action_WinInfo_Rect.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_RECT); Action_WinInfo_ControlID.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_CONTROLID); Action_WinInfo_Style.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_STYLE); Action_WinInfo_Enabled.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_ENABLED); Action_WinInfo_ParentWindow.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_PARENT); Action_WinInfo_PID.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_PID); Action_WinInfo_ExeName.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_EXENAME); Action_WinInfo_FileVersion.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_VERSION); Action_WinInfo_StyleVerbose.Checked := gfnbFlagCheck(iWInfoFlag, G_ciFLG_WINFO_STYLEVERBOSE); // Action_WinInfo_StyleVerboseExecute(nil); フォームの表示位置を決定してから呼ぶ必要あり //[Option] Action_Opt_StayOnTop.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_STAYONTOP); Action_Opt_TitleBar.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_TITLEBAR); Action_Opt_ToolBar.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_TOOLBAR); Action_Opt_LargeIcon.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_LARGEICON); // Action_Opt_BigFont.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_BIGFONT); Action_Opt_LineTo.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_LINETO); Action_Opt_ZoomWheel.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_ZOOMWHEEL); Action_Test_APITest.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_APITEST); //以下の二つはオプションからキャプチャに移動したが互換性維持のためこのままにする。 Action_Capture_NoSelfCapture.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_NOSELF); Action_Capture_SmoothCapture.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_SMOOTH); // Action_Copy_OptUnicode.Checked := gfnbFlagCheck(iOptFlag, G_ciFLG_OPT_COPYUNICODE); // Action_Copy_OptUnicodeExecute(nil); Action_Opt_StayOnTopExecute(Action_Opt_StayOnTop); Action_Opt_TitleBarExecute (Action_Opt_TitleBar); Action_Opt_ToolBarExecute (Action_Opt_ToolBar); // Action_Opt_BigFontExecute (Action_Opt_BigFont); //[Capture] Action_Capture_Lupe.Checked := gfnbFlagCheck(iCaptureFlag, G_ciFLG_CAPTURE_LUPE); Action_Capture_Fixed.Checked := gfnbFlagCheck(iCaptureFlag, G_ciFLG_CAPTURE_FIXED); if (Action_Capture_Lupe.Checked) then begin Action_Capture_LupeExecute(Action_Capture_Lupe); end else if (Action_Capture_Fixed.Checked) then begin // actCapture_FixedExecute(actCapture_Fixed); FrDispInfo.ptMousePos := ptCaptruePos; FSetPanelVisible; end; //[ShortCutKey] //初期設定をクリア G_pcClearShortCut; for k := 0 to High(G_rShortCutKeys) do begin if (G_rShortCutKeys[k].iCommand <> 0) then begin G_ShortCutList.Add(T_ShortCutAction.Create(G_rShortCutKeys[k].iKey, Get_CommandToAction(G_rShortCutKeys[k].iCommand))); end; end; //[MouseGesture] G_GestureUp := Get_CommandToAction(G_rMouseGesture.iCommand_Up); G_GestureDown := Get_CommandToAction(G_rMouseGesture.iCommand_Down); G_GestureLeft := Get_CommandToAction(G_rMouseGesture.iCommand_Left); G_GestureRight := Get_CommandToAction(G_rMouseGesture.iCommand_Right); //[Bounds] if (gfniRectWidth (rcRect) <= FciMINSIZE) or (gfniRectHeight(rcRect) <= FciMINSIZE) then begin li_Width := Width; li_Height := Height; end else begin //[Bounds] li_Width := gfniRectWidth(rcRect); li_Height := gfniRectHeight(rcRect); end; if (gfnbKeyState(VK_SHIFT)) then begin //Shiftキーを押しながら起動で(0,0)に移動 li_Left := 0; li_Top := 0; end else begin li_Left := rcRect.Left; li_Top := rcRect.Top; end; SetBounds(li_Left, li_Top, li_Width, li_Height); if not(gfnbKeyState(VK_CONTROL)) then begin //画面内に収まるように調整 //ただし情報エリアは画面外にはみ出して起動する場合あり。 MyScreenSize.SetBounds(Self); end else begin //Ctrlキーを押して起動した場合は調整はせず設定ファイルに従った位置と大きさで起動 //何らかの意図で画面外に起動させたい場合にも対応。 end; end; { FrDispInfo.clOpt_BkColor := G_SettingInfo2.clOpt_BkColor; FBitmapNoSelf.Canvas.Brush.Color := FrDispInfo.clOpt_BkColor; FBitmapDesktop.Canvas.Brush.Color := FrDispInfo.clOpt_BkColor; } FrDispInfo.fpCapture_ZoomFlip := TZoomFlip(G_SettingInfo2.iCapture_Flip); case FrDispInfo.fpCapture_ZoomFlip of fpFlipHorizontal : l_Action := Action_Test_FlipHorizontal; fpFlipVertical : l_Action := Action_Test_FlipVertical; fpRotate90 : l_Action := Action_Test_Rotate90; fpRotate180 : l_Action := Action_Test_Rotate180; fpRotate270 : l_Action := Action_Test_Rotate270; else l_Action := Action_Test_FlipNone; end; l_Action.Checked := True; //フォント if (G_FontInfo.Size.iFontNameLength > 0) then begin FBitmapDraw.Canvas.Font.Name := gfnsUtf8ToWide(G_FontInfo.sName); FBitmapDraw.Canvas.Font.Size := G_FontInfo.Size.iFontSize; FiVLine := G_FontInfo.Size.iInfoVLine; end; end; procedure TApp_BugsEye.FSaveBin; procedure _SetCheckFlag(bFlag: Boolean; var iWordFlag: Word; iFlag: Word); overload; begin if (bFlag) then begin iWordFlag := iWordFlag or iFlag; end; end; procedure _SetCheckFlag(bFlag: Boolean; var iLongFlag: Longword; iFlag: Longword); overload; begin if (bFlag) then begin iLongFlag := iLongFlag or iFlag; end; end; var i, k: Integer; li_Key: Word; begin with G_rSettingInfo do begin rcRect := Self.BoundsRect; Dec(rcRect.Bottom, gfniRectHeight(FrcInfo)); //[Zoom] iZoomIndex := FiZoomIndex; //[Grid] iGridFlag := 0; _SetCheckFlag(Action_Grid_Disp.Checked, iGridFlag, G_ciFLG_GRID_DISP); _SetCheckFlag(Action_Grid_UseSubElseColor.Checked, iGridFlag, G_ciFLG_GRID_ELSECOLOR); iGridIndex := MenuItem_Grid_Gray.MenuIndex; for i := MenuItem_Grid_LineGrid.MenuIndex +1 to MenuItem_Grid_LineSubGrid.MenuIndex -1 do begin if (MenuItem_Grid.Items[i].Checked) then begin iGridIndex := i; Break; end; end; //選択されているサブグリッドメニュー iSubGridIndex := MenuItem_Grid_SubBlue.MenuIndex; for i := MenuItem_Grid_LineSubGrid.MenuIndex +1 to MenuItem_Grid.Count -1 do begin if (MenuItem_Grid.Items[i].Checked) then begin iSubGridIndex := i; Break; end; end; iSubGridIndex := iSubGridIndex - (MenuItem_Grid_LineSubGrid.MenuIndex +1); //選択色 clGridColor := DWORD(ColorToRGB(Action_Grid_SelColor.Tag)); clSubGridColor := DWORD(ColorToRGB(Action_Grid_SelSubColor.Tag)); clSubGridElseColor := DWORD(ColorToRGB(Action_Grid_SelSubElseColor.Tag)); //[Color] iColorFlag := 0; _SetCheckFlag(Action_Color_RGB.Checked, iColorFlag, G_ciFLG_COLOR_RGB); _SetCheckFlag(Action_Color_HTML.Checked, iColorFlag, G_ciFLG_COLOR_HTML); _SetCheckFlag(Action_Color_COLORREF.Checked, iColorFlag, G_ciFLG_COLOR_COLORREF); _SetCheckFlag(Action_Color_HSV.Checked, iColorFlag, G_ciFLG_COLOR_HSV); _SetCheckFlag(Action_Color_HLS.Checked, iColorFlag, G_ciFLG_COLOR_HLS); _SetCheckFlag(Action_Color_HLSWin.Checked, iColorFlag, G_ciFLG_COLOR_HLSWIN); //[Position] iPosFlag := 0; _SetCheckFlag(Action_Pos_Screen.Checked, iPosFlag, G_ciFLG_POS_SCREEN); _SetCheckFlag(Action_Pos_Monitor.Checked, iPosFlag, G_ciFLG_POS_MONITOR); _SetCheckFlag(Action_Pos_Client.Checked, iPosFlag, G_ciFLG_POS_CLIENT); _SetCheckFlag(Action_Pos_Length.Checked, iPosFlag, G_ciFLG_POS_LENGTH); { //論理座標 _SetCheckFlag(Action_Pos_LogicalScreen.Checked, iPosFlag, G_ciFLG_POS_LOGICALSCREEN); _SetCheckFlag(Action_Pos_LogicalMonitor.Checked, iPosFlag, G_ciFLG_POS_LOGICALMONITOR); _SetCheckFlag(Action_Pos_LogicalClient.Checked, iPosFlag, G_ciFLG_POS_LOGICALCLIENT); _SetCheckFlag(Action_Pos_LogicalLength.Checked, iPosFlag, G_ciFLG_POS_LOGICALLENGTH); } ptLengthPos := FrDispInfo.ptLengthPos; //[WindowsInfo] iWInfoFlag := 0; _SetCheckFlag(Action_WinInfo_Handle.Checked, iWInfoFlag, G_ciFLG_WINFO_HANDLE); _SetCheckFlag(Action_WinInfo_ClassName.Checked, iWInfoFlag, G_ciFLG_WINFO_CLASSNAME); _SetCheckFlag(Action_WinInfo_Text.Checked, iWInfoFlag, G_ciFLG_WINFO_TEXT); _SetCheckFlag(Action_WinInfo_WindowSize.Checked, iWInfoFlag, G_ciFLG_WINFO_WINDOWSIZE); _SetCheckFlag(Action_WinInfo_ClientSize.Checked, iWInfoFlag, G_ciFLG_WINFO_CLIENTSIZE); _SetCheckFlag(Action_WinInfo_Rect.Checked, iWInfoFlag, G_ciFLG_WINFO_RECT); _SetCheckFlag(Action_WinInfo_ControlID.Checked, iWInfoFlag, G_ciFLG_WINFO_CONTROLID); _SetCheckFlag(Action_WinInfo_Style.Checked, iWInfoFlag, G_ciFLG_WINFO_STYLE); _SetCheckFlag(Action_WinInfo_Enabled.Checked, iWInfoFlag, G_ciFLG_WINFO_ENABLED); _SetCheckFlag(Action_WinInfo_ParentWindow.Checked, iWInfoFlag, G_ciFLG_WINFO_PARENT); _SetCheckFlag(Action_WinInfo_PID.Checked, iWInfoFlag, G_ciFLG_WINFO_PID); _SetCheckFlag(Action_WinInfo_ExeName.Checked, iWInfoFlag, G_ciFLG_WINFO_EXENAME); _SetCheckFlag(Action_WinInfo_FileVersion.Checked, iWInfoFlag, G_ciFLG_WINFO_VERSION); _SetCheckFlag(Action_WinInfo_StyleVerbose.Checked, iWInfoFlag, G_ciFLG_WINFO_STYLEVERBOSE); {$IFNDEF PLUGIN} //[WindowStyle] if (gfnbFormExists(App_BugsEyeWindowStyle)) then begin iStyleFlag := 0; _SetCheckFlag(App_BugsEyeWindowStyle.chkButton.Checked, iStyleFlag, G_ciFLG_STYLE_BUTTON); _SetCheckFlag(App_BugsEyeWindowStyle.chkEdit.Checked, iStyleFlag, G_ciFLG_STYLE_EDIT); _SetCheckFlag(App_BugsEyeWindowStyle.chkStatic.Checked, iStyleFlag, G_ciFLG_STYLE_STATIC); _SetCheckFlag(App_BugsEyeWindowStyle.chkComboBox.Checked, iStyleFlag, G_ciFLG_STYLE_COMBOBOX); _SetCheckFlag(App_BugsEyeWindowStyle.chkListBox.Checked, iStyleFlag, G_ciFLG_STYLE_LISTBOX); _SetCheckFlag(App_BugsEyeWindowStyle.chkDialog.Checked, iStyleFlag, G_ciFLG_STYLE_DIALOG); _SetCheckFlag(App_BugsEyeWindowStyle.chkScrollBar.Checked, iStyleFlag, G_ciFLG_STYLE_SCROLLBAR); end; {$ENDIF} //[Option] iOptFlag := 0; _SetCheckFlag(Action_Opt_StayOnTop.Checked, iOptFlag, G_ciFLG_OPT_STAYONTOP); _SetCheckFlag(Action_Opt_TitleBar.Checked, iOptFlag, G_ciFLG_OPT_TITLEBAR); _SetCheckFlag(Action_Opt_ToolBar.Checked, iOptFlag, G_ciFLG_OPT_TOOLBAR); _SetCheckFlag(Action_Opt_LargeIcon.Checked, iOptFlag, G_ciFLG_OPT_LARGEICON); // _SetCheckFlag(Action_Opt_BigFont.Checked, iOptFlag, G_ciFLG_OPT_BIGFONT); _SetCheckFlag(Action_Opt_ZoomWheel.Checked, iOptFlag, G_ciFLG_OPT_ZOOMWHEEL); _SetCheckFlag(Action_Test_APITest.Checked, iOptFlag, G_ciFLG_OPT_APITEST); _SetCheckFlag(Action_Capture_NoSelfCapture.Checked, iOptFlag, G_ciFLG_OPT_NOSELF); _SetCheckFlag(Action_Capture_SmoothCapture.Checked, iOptFlag, G_ciFLG_OPT_SMOOTH); _SetCheckFlag(Action_Opt_LineTo.Checked, iOptFlag, G_ciFLG_OPT_LINETO); // _SetCheckFlag(Action_Copy_OptUnicode.Checked, iOptFlag, G_ciFLG_OPT_COPYUNICODE); //[Capture] iCaptureFlag := 0; if (Action_Capture_Lupe.Checked) then begin iCaptureFlag := G_ciFLG_CAPTURE_LUPE; end else if (Action_Capture_Fixed.Checked) then begin iCaptureFlag := G_ciFLG_CAPTURE_FIXED; end; ptCaptruePos := FrDispInfo.ptMousePos; end; FillChar(G_rShortCutKeys, SizeOf(G_rShortCutKeys), 0); for i := 0 to G_ShortCutList.Count -1 do begin li_Key := T_ShortCutAction(G_ShortCutList.Items[i]).Key; for k := 0 to High(G_rShortCutKeys) do begin G_rShortCutKeys[k].iKey := G_rINIT_SHORTCUTKEYS[k].iKey; if (G_rShortCutKeys[k].iKey = li_Key) then begin G_rShortCutKeys[k].iCommand := Get_ActionToCommand(T_ShortCutAction(G_ShortCutList.Items[i]).Action); Break; end; end; end; FillChar(G_rMouseGesture, SizeOf(G_rMouseGesture), 0); with G_rMouseGesture do begin iCommand_Up := Get_ActionToCommand(G_GestureUp); iCommand_Down := Get_ActionToCommand(G_GestureDown); iCommand_Left := Get_ActionToCommand(G_GestureLeft); iCommand_Right := Get_ActionToCommand(G_GestureRight); end; FillChar(G_SettingInfo2, SizeOf(G_SettingInfo2), 0); // G_SettingInfo2.clOpt_BkColor := DWORD(ColorToRGB(FrDispInfo.clOpt_BkColor)); G_SettingInfo2.iCapture_Flip := Longword(FrDispInfo.fpCapture_ZoomFlip); //フォント FillChar(G_FontInfo.Size, SizeOf(G_FontInfo.Size), 0); G_FontInfo.sName := gfnsWideToUtf8(FBitmapDraw.Canvas.Font.Name); G_FontInfo.Size.iFontNameLength := Length(G_FontInfo.sName); G_FontInfo.Size.iFontSize := FBitmapDraw.Canvas.Font.Size; G_FontInfo.Size.iInfoVLine := FiVLine; G_pcSettingWrite; //(lr_SettingInfo, lr_ShortCutKeys, lr_MouseGesture); end; {$IFDEF WRITE_CLIPBOARD_TEXT} procedure TApp_BugsEye.FSetWriteMenuCaption(AMenuItem: TMenuItem; sAdd: WideString); const lci_MAXLEN = 30; var ls_Str : WideString; l_Action : TAction; begin if (Length(sAdd) > lci_MAXLEN) then begin ls_Str := WideFormat('%s...', [Copy(sAdd, 1, lci_MAXLEN)]); end else begin ls_Str := sAdd; end; // ls_Str := Trim(ls_Str); l_Action := TAction(AMenuItem.Action); if (l_Action <> nil) then begin ls_Str := gfnsStrReplace(ls_Str, '&', '&&'); ls_Str := gfnsStrReplace(ls_Str, #9, ' '); AMenuItem.Caption := Format('%s 「%s」', [l_Action.Caption, gfnsWideToAnsiEx(ls_Str)]); // AMenuItem.Caption := Format('%s 「%s」', [l_Action.Caption, gfnsWideToAnsiEx(gfnsStrReplace(sAdd, '&', '&&'))]); end; end; {$ENDIF} procedure TApp_BugsEye.Action_Write_InfoCashExecute(Sender: TObject); //テキスト書き込み用に情報をキャッシュ var i : Integer; l_MenuItem : TMenuItem; l_Action : TAction; {$IFDEF WRITE_CLIPBOARD_TEXT} li_Hue, li_Value, li_Saturation: WORD; lr_Monitor : TMyMonitorPos; li_Width : Integer; li_Height : Integer; {$ENDIF} begin FWriteInfo := FrDispInfo; for i := MenuItem_Write_ColorRGB.MenuIndex to MenuItem_Write.Count -1 do begin l_MenuItem := MenuItem_Write.Items[i]; l_Action := TAction(l_MenuItem.Action); if (l_Action <> nil) then begin l_Action.Enabled := True; end; { if (l_Action = nil) then begin end else begin myDebug.gpcDebug(Format(' _SetCaption(%s, );', [l_MenuItem.Name])); end; } end; {$IFDEF WRITE_CLIPBOARD_TEXT} with FWriteInfo do begin //カラー値 //RGB FSetWriteMenuCaption(MenuItem_Write_ColorRGB, WideFormat(CopyFmt[G_ciFMTCOLOR_RGB], [iRed, iGreen, iBlue])); //RGB FSetWriteMenuCaption(MenuItem_Write_ColorRGBRed, WideFormat(CopyFmt[G_ciFMTCOLOR_RGBRED], [iRed])); //RGBの赤 FSetWriteMenuCaption(MenuItem_Write_ColorRGBGreen, WideFormat(CopyFmt[G_ciFMTCOLOR_RGBGREEN], [iGreen])); //RGBの緑 FSetWriteMenuCaption(MenuItem_Write_ColorRGBBlue, WideFormat(CopyFmt[G_ciFMTCOLOR_RGBBLUE], [iBlue])); //RGBの青 //HTML FSetWriteMenuCaption(MenuItem_Write_ColorHTML, WideFormat(CopyFmt[G_ciFMTCOLOR_HTML], [clColor])); //COLORREF FSetWriteMenuCaption(MenuItem_Write_ColorCOLORREF, WideFormat(CopyFmt[G_ciFMTCOLOR_COLORREF], [clColorRef])); //HSV gpcColorRGBToHSV(iRed, iGreen, iBlue, li_Hue, li_Value, li_Saturation, 360, 100, 100); FSetWriteMenuCaption(MenuItem_Write_ColorHSV, WideFormat(CopyFmt[G_ciFMTCOLOR_HSV], [li_Hue, li_Saturation, li_Value])); //HSV FSetWriteMenuCaption(MenuItem_Write_ColorHSVHue, WideFormat(CopyFmt[G_ciFMTCOLOR_HSVHUE], [li_Hue])); //HSV - Hue FSetWriteMenuCaption(MenuItem_Write_ColorHSVSaturation, WideFormat(CopyFmt[G_ciFMTCOLOR_HSVSATURATION], [li_Saturation])); //HSV - Saturation FSetWriteMenuCaption(MenuItem_Write_ColorHSVValue, WideFormat(CopyFmt[G_ciFMTCOLOR_HSVVALUE], [li_Value])); //HSV - Value //HLS gpcColorRGBToHLS(iRed, iGreen, iBlue, li_Hue, li_Value, li_Saturation, 360, 100, 100); FSetWriteMenuCaption(MenuItem_Write_ColorHLS, WideFormat(CopyFmt[G_ciFMTCOLOR_HLS], [li_Hue, li_Saturation, li_Value])); //HLS FSetWriteMenuCaption(MenuItem_Write_ColorHLSHue, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSHUE], [li_Hue])); //HLS - Hue FSetWriteMenuCaption(MenuItem_Write_ColorHLSSaturation, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSSATURATION], [li_Saturation])); //HLS - Saturation FSetWriteMenuCaption(MenuItem_Write_ColorHLSLightness, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSLIGHTNESS], [li_Value])); //HLS - Lightness //HLS Windows gpcColorRGBToHLS(iRed, iGreen, iBlue, li_Hue, li_Value, li_Saturation, 240, 240, 240); FSetWriteMenuCaption(MenuItem_Write_ColorHLSWin, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWIN], [li_Hue, li_Saturation, li_Value])); //HLS Windows FSetWriteMenuCaption(MenuItem_Write_ColorHLSWinHue, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWINHUE], [li_Hue])); //HLSWin - Hue FSetWriteMenuCaption(MenuItem_Write_ColorHLSWinSaturation, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWINSATURATION], [li_Saturation])); //HLSWin - Saturation FSetWriteMenuCaption(MenuItem_Write_ColorHLSWinLightness, WideFormat(CopyFmt[G_ciFMTCOLOR_HLSWINLIGHTNESS], [li_Value])); //HLSWin - Lightness //カーソル位置 //スクリーン座標 FSetWriteMenuCaption(MenuItem_Write_PosScreen, WideFormat(CopyFmt[G_ciFMTPOS_SCREEN], [ptMousePos.X, ptMousePos.Y])); //スクリーン座標 FSetWriteMenuCaption(MenuItem_Write_PosScreenX, WideFormat(CopyFmt[G_ciFMTPOS_SCREEN_X], [ptMousePos.X])); //スクリーン座標 - X FSetWriteMenuCaption(MenuItem_Write_PosScreenY, WideFormat(CopyFmt[G_ciFMTPOS_SCREEN_Y], [ptMousePos.Y])); //スクリーン座標 - Y //モニター座標 lr_Monitor := gfnrScreenToMonitor(MyScreenSize, ptMousePos); FSetWriteMenuCaption(MenuItem_Write_PosMonitor, WideFormat(CopyFmt[G_ciFMTPOS_MONITOR], [lr_Monitor.Position.X, lr_Monitor.Position.Y])); //モニター座標 FSetWriteMenuCaption(MenuItem_Write_PosMonitorX, WideFormat(CopyFmt[G_ciFMTPOS_MONITOR_X], [lr_Monitor.Position.X])); //モニター座標 - X FSetWriteMenuCaption(MenuItem_Write_PosMonitorY, WideFormat(CopyFmt[G_ciFMTPOS_MONITOR_Y], [lr_Monitor.Position.Y])); //モニター座標 - Y //クライアント座標 FSetWriteMenuCaption(MenuItem_Write_PosClient, WideFormat(CopyFmt[G_ciFMTPOS_CLIENT], [ptMousePos.X - ptClientPos.X, ptMousePos.Y - ptClientPos.Y])); //クライアント座標 FSetWriteMenuCaption(MenuItem_Write_PosClientX, WideFormat(CopyFmt[G_ciFMTPOS_CLIENT_X], [ptMousePos.X - ptClientPos.X])); //クライアント座標 - X FSetWriteMenuCaption(MenuItem_Write_PosClientY, WideFormat(CopyFmt[G_ciFMTPOS_CLIENT_Y], [ptMousePos.Y - ptClientPos.Y])); //クライアント座標 - Y //長さ li_Width := Abs(ptMousePos.X - ptUserPos.X) +1; li_Height := Abs(ptMousePos.Y - ptUserPos.Y) +1; FSetWriteMenuCaption(MenuItem_Write_PosUser, WideFormat(CopyFmt[G_ciFMTPOS_USER], [li_Width, li_Height, ptUserPos.X, ptUserPos.Y])); //長さ FSetWriteMenuCaption(MenuItem_Write_PosUserWidth, WideFormat(CopyFmt[G_ciFMTPOS_USER_WIDTH], [li_Width])); //長さ - 幅 FSetWriteMenuCaption(MenuItem_Write_PosUserHeight, WideFormat(CopyFmt[G_ciFMTPOS_USER_HEIGHT], [li_Height])); //長さ - 高さ //ウィンドウ情報 //ハンドル FSetWriteMenuCaption(MenuItem_Write_WinInfoHandle, WideFormat(CopyFmt[G_ciFMTWININFO_HANDLE], [hWinHandle])); //クラス名 FSetWriteMenuCaption(MenuItem_Write_WinInfoClassName, gfnsWideFormat(CopyFmt[G_ciFMTWININFO_CLASSNAME], [sWinClass])); //テキスト FSetWriteMenuCaption(MenuItem_Write_WinInfoText, gfnsWideFormat(CopyFmt[G_ciFMTWININFO_TEXT], [sWinText])); //ウィンドウサイズ FSetWriteMenuCaption(MenuItem_Write_WinInfoWindowSize, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE], [szWindowSize.Left, szWindowSize.Top, szWindowSize.Width, szWindowSize.Height, '', ''])); gfnsWideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE], [szWindowSize.Left, szWindowSize.Top, szWindowSize.Width, szWindowSize.Height, '', '']); //ウィンドウサイズ FSetWriteMenuCaption(MenuItem_Write_WinInfoWindowSizeLeft, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_LEFT], [szWindowSize.Left])); //ウィンドウサイズ - Left FSetWriteMenuCaption(MenuItem_Write_WinInfoWindowSizeTop, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_TOP], [szWindowSize.Top])); //ウィンドウサイズ - Top FSetWriteMenuCaption(MenuItem_Write_WinInfoWindowSizeWidth, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_WIDTH], [szWindowSize.Width])); //ウィンドウサイズ - Width FSetWriteMenuCaption(MenuItem_Write_WinInfoWindowSizeHeight, WideFormat(CopyFmt[G_ciFMTWININFO_WINDOWSIZE_HEIGHT], [szWindowSize.Height])); //ウィンドウサイズ - Height //クライアントサイズ FSetWriteMenuCaption(MenuItem_Write_WinInfoClientSize, WideFormat(CopyFmt[G_ciFMTWININFO_CLIENTSIZE], [szClientSize.Width, szClientSize.Height])); //クライアントサイズ FSetWriteMenuCaption(MenuItem_Write_WinInfoClientSizeWidth, WideFormat(CopyFmt[G_ciFMTWININFO_CLIENTSIZE_WIDTH], [szClientSize.Width])); //クライアントサイズ - Width FSetWriteMenuCaption(MenuItem_Write_WinInfoClientSizeHeight, WideFormat(CopyFmt[G_ciFMTWININFO_CLIENTSIZE_HEIGHT], [szClientSize.Height])); //クライアントサイズ - Height //RECT FSetWriteMenuCaption(MenuItem_Write_WinInfoRect, WideFormat(CopyFmt[G_ciFMTWININFO_RECT], [rcWinRect.Left, rcWinRect.Top, rcWinRect.Right, rcWinRect.Bottom])); //RECT FSetWriteMenuCaption(MenuItem_Write_WinInfoRectLeft, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_LEFT], [rcWinRect.Left])); //RECT - Left FSetWriteMenuCaption(MenuItem_Write_WinInfoRectTop, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_TOP], [rcWinRect.Top])); //RECT - Top FSetWriteMenuCaption(MenuItem_Write_WinInfoRectRight, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_RIGHT], [rcWinRect.Right])); //RECT - Right FSetWriteMenuCaption(MenuItem_Write_WinInfoRectBottom, WideFormat(CopyFmt[G_ciFMTWININFO_RECT_BOTTOM], [rcWinRect.Bottom])); //RECT - Bottom //コントロールID FSetWriteMenuCaption(MenuItem_Write_WinInfoStyle, WideFormat(CopyFmt[G_ciFMTWININFO_CONTROLID], [iControlID])); //ウィンドウスタイル FSetWriteMenuCaption(MenuItem_Write_WinInfoStyle, WideFormat(CopyFmt[G_ciFMTWININFO_STYLE], [iStyle])); //拡張ウィンドウスタイル FSetWriteMenuCaption(MenuItem_Write_WinInfoStyleEx, WideFormat(CopyFmt[G_ciFMTWININFO_STYLEEX], [iStyleEx])); //プロセスID。 FSetWriteMenuCaption(MenuItem_Write_WinInfoPID, WideFormat(CopyFmt[G_ciFMTWININFO_PID], [iProcessID])); //実行ファイル名 FSetWriteMenuCaption(MenuItem_Write_WinInfoExeName, gfnsWideFormat(CopyFmt[G_ciFMTWININFO_EXENAME], [sExeName, gfnsFileNameGet(sExeName)])); //ファイルバージョン FSetWriteMenuCaption(MenuItem_Write_WinInfoFileVersion, WideFormat(CopyFmt[G_ciFMTWININFO_FILEVERSION], [sFileVersion])); end; {$ENDIF} DrawNow; end; procedure TApp_BugsEye.Action_Write_ClearCashExecute(Sender: TObject); var i : Integer; l_MenuItem : TMenuItem; l_Action : TAction; begin FWriteInfo.sWinClass := ''; FWriteInfo.sWinText := ''; FWriteInfo.sParentClassName := ''; FWriteInfo.sParentText := ''; FWriteInfo.sExeName := ''; FWriteInfo.sFileVersion := ''; FillChar(FWriteInfo, SizeOf(FWriteInfo), 0); for i := MenuItem_Write_ColorRGB.MenuIndex to MenuItem_Write.Count -1 do begin l_MenuItem := MenuItem_Write.Items[i]; if (l_MenuItem.Caption <> '-') then begin l_Action := TAction(l_MenuItem.Action); if (l_Action <> nil) then begin l_MenuItem.Caption := l_Action.Caption; l_Action.Enabled := False; end; end; end; DrawNow; end; procedure TApp_BugsEye.Action_Write_ColorRGBExecute(Sender: TObject); //対象ウィンドウのウィンドウテキストに書き込み var ls_Text : WideString; lh_Handle : HWND; li_Ret : DWORD; li_Dummy : Integer; l_Item : T_WinItem; begin if not(Sender is TAction) then begin Exit; end; if ((Sender <> Action_Write_TextClear) and (Sender <> Action_Write_ClipboardText)) and (FWriteInfo.hWinHandle = 0) then begin Exit; end; li_Dummy := 0; if (Sender = Action_Write_ClipboardText) then begin ls_Text := gfnsStrFromClipboard; end else if (Sender = Action_Write_TextClear) then begin //テキストクリア ls_Text := ''; end else begin ls_Text := FPutInfo(Sender, FWriteInfo, li_Dummy); end; lh_Handle := 0; if (Action_Capture_Pause.Checked) then begin //一時停止 if (FWinList <> nil) then begin //一時停止中は保持しておいたデータの方を参照する。 l_Item := FWinList.FindWindowItem( FrDispInfo.ptMousePos, FIsActionEnabled(MenuItem_Capture_NoSelfCapture) or FIsActionEnabled(MenuItem_Capture_Lupe) ); if (l_Item <> nil) then begin lh_Handle := l_Item.Handle; end else begin lh_Handle := 0; end; end; end else begin lh_Handle := FGetWindow(FrDispInfo.ptMousePos); end; if (IsWindow(lh_Handle)) then begin Beep; SendMessageTimeoutW(lh_Handle, WM_SETTEXT, 0, LPARAM(PWideChar(ls_Text)), SMTO_ABORTIFHUNG, 500, li_Ret); end; end; procedure TApp_BugsEye.Action_Test_APITestExecute(Sender: TObject); begin if not(gfnbFormExists(App_BugsEyeAPITest)) then begin if (Action_Test_APITest.Checked) then begin App_BugsEyeAPITest := TApp_BugsEyeAPITest.Create(Self); App_BugsEyeAPITest.Show; end else begin Exit; end; end else begin App_BugsEyeAPITest.Visible := Action_Test_APITest.Checked; end; end; procedure TApp_BugsEye.MenuItem_WriteAdvancedDrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState); const lci_MARGIN = 2; lci_CHECKWIDTH = 16; lci_CHECKHEIGHT = 16; var l_MenuItem: TMenuItem; l_Bitmap, l_Check: TBitmap; li_Width, li_Height, li_Top, li_Left: Integer; lrc_Rect: TRect; begin l_MenuItem := TMenuItem(Sender); { if (l_MenuItem.GetParentMenu is TMainMenu) and (l_MenuItem.Parent = l_MenuItem.GetParentMenu.Items) then begin //メインメニューのメニューバー MenuBarAdvancedDrawItem(Sender, ACanvas, ARect, State); Exit; end; } if (odSelected in State) or (odHotLight in State) //ホットトラッキング then begin ACanvas.Brush.Color := clHighlight; ACanvas.Font.Color := clHighlightText; end else begin ACanvas.Brush.Color := clMenu; if (odGrayed in State) or (odDisabled in State) then begin //選択不可 ACanvas.Font.Color := clGrayText; end else begin ACanvas.Font.Color := clMenuText; end; end; //塗りつぶす ACanvas.FillRect(ARect); //チェックマーク描画 li_Height := ARect.Bottom - ARect.Top; li_Width := li_Height; lrc_Rect := Rect(ARect.Left, ARect.Top, ARect.Left + li_Width, ARect.Bottom); if (odChecked in State) then begin l_Check := TBitmap.Create; try l_Check.Width := lci_CHECKWIDTH; l_Check.Height := lci_CHECKHEIGHT; l_Bitmap := TBitmap.Create; try l_Bitmap.Width := l_Check.Width; l_Bitmap.Height := l_Check.Height; l_Bitmap.Canvas.Brush.Color := ACanvas.Font.Color; l_Bitmap.Canvas.FillRect(Rect(0, 0, l_Bitmap.Width, l_Bitmap.Height)); if (l_MenuItem.RadioItem) then begin l_Check.Handle := LoadBitmap(HInstance, PChar('MENU_RADIOMASK')); end else begin l_Check.Handle := LoadBitmap(HInstance, PChar('MENU_CHECKMASK')); end; BitBlt(l_Bitmap.Canvas.Handle, 0, 0, l_Bitmap.Width, l_Bitmap.Height, l_Check.Canvas.Handle, 0, 0, SRCAND); if (l_MenuItem.RadioItem) then begin l_Check.Handle := LoadBitmap(HInstance, PChar('MENU_RADIO')); end else begin l_Check.Handle := LoadBitmap(HInstance, PChar('MENU_CHECK')); end; li_Left := lrc_Rect.Left + (li_Width - l_Bitmap.Width) div 2; li_Top := lrc_Rect.Top + (li_Height - l_Bitmap.Height) div 2; BitBlt(ACanvas.Handle, li_Left, li_Top, l_Bitmap.Width, l_Bitmap.Height, l_Check.Canvas.Handle, 0, 0, SRCAND); BitBlt(ACanvas.Handle, li_Left, li_Top, l_Bitmap.Width, l_Bitmap.Height, l_Bitmap.Canvas.Handle, 0, 0, SRCPAINT); finally l_Bitmap.Free; end; finally l_Check.Free; end; end; if (l_MenuItem.Default) then begin //デフォルト ACanvas.Font.Style := ACanvas.Font.Style + [fsBold]; end; lrc_Rect.Left := lrc_Rect.Left + li_Width; lrc_Rect.Right := ARect.Right; Inc(lrc_Rect.Left, lci_MARGIN); //キャプション描画 DrawTextW(ACanvas.Handle, PWideChar(gfnsAnsiToWideEx(l_MenuItem.Caption)), -1, lrc_Rect, DT_SINGLELINE or DT_VCENTER); if (l_MenuItem.ShortCut <> 0) then begin //ショートカット描画 Dec(lrc_Rect.Right, GetSystemMetrics(SM_CXMENUCHECK)); SetBkMode(ACanvas.Handle, TRANSPARENT); DrawTextW(ACanvas.Handle, PWideChar(WideString(ShortCutToText(l_MenuItem.ShortCut))), -1, lrc_Rect, DT_SINGLELINE or DT_NOPREFIX or DT_RIGHT or DT_VCENTER); end; end; procedure TApp_BugsEye.MenuItem_WriteMeasureItem(Sender: TObject; ACanvas: TCanvas; var Width, Height: Integer); procedure _CalcRect(AMenuItem: TMenuItem; ACanvas: TCanvas; sCaption: WideString; var ARect: TRect; iFormat: UINT); begin if not(AMenuItem.Enabled) then begin OffsetRect(ARect, 1, 1); DrawTextW(ACanvas.Handle, PWideChar(sCaption), -1, ARect, iFormat); OffsetRect(ARect, -1, -1); end; DrawTextW(ACanvas.Handle, PWideChar(sCaption), -1, ARect, iFormat); end; var l_MenuItem : TMenuItem; ls_Text : AnsiString; li_Format : UINT; l_Menu : TMenu; l_AnsiRect : TRect; l_WideRect : TRect; begin if not(Sender is TMenuItem) then begin Exit; end; l_MenuItem := TMenuItem(Sender); if (l_MenuItem.IsLine) then begin Exit; end; ls_Text := l_MenuItem.Caption; if (l_MenuItem.ShortCut <> 0) then begin ls_Text := ls_Text + ShortCutToText(l_MenuItem.ShortCut); end; if (ls_Text = '') or ((ls_Text[1] = cHotkeyPrefix) and (ls_Text[2] = #0)) then begin ls_Text := ls_Text + ' '; end; l_Menu := l_MenuItem.GetParentMenu; li_Format := DT_LEFT; if (l_Menu is TPopupMenu) then begin case TPopupMenu(l_Menu).Alignment of paCenter : li_Format := DT_CENTER; paRight : li_Format := DT_RIGHT; end; end; if (l_Menu <> nil) and (l_Menu.IsRightToLeft) then begin if ((li_Format and DT_LEFT) = DT_LEFT) then begin li_Format := li_Format and (not DT_LEFT) or DT_RIGHT; end else if ((li_Format and DT_RIGHT) = DT_RIGHT) then begin li_Format := li_Format and (not DT_RIGHT) or DT_LEFT; end; li_Format := li_Format or DT_RTLREADING; end; li_Format := li_Format {or DT_EXPANDTABS} or DT_SINGLELINE or DT_NOCLIP or DT_CALCRECT; if (l_MenuItem.Default) then begin ACanvas.Font.Style := ACanvas.Font.Style + [fsBold]; end; FillChar(l_AnsiRect, SizeOf(l_AnsiRect), 0); _CalcRect(l_MenuItem, ACanvas, ls_Text, l_AnsiRect, li_Format); FillChar(l_WideRect, SizeOf(l_WideRect), 0); _CalcRect(l_MenuItem, ACanvas, gfnsAnsiToWideEx(ls_Text), l_WideRect, li_Format); Width := Width - (gfniRectWidth(l_AnsiRect) - gfniRectWidth(l_WideRect)); end; procedure TApp_BugsEye.Action_Opt_LargeIconExecute(Sender: TObject); const lci_LARGE_ICON_SIZE = 36; lci_SMALL_ICON_SIZE = 18; lci_LARGE_BUTTON_SIZE = 42; lci_SMALL_BUTTON_SIZE = 24; var i : Integer; li_Height : Integer; li_Width : Integer; l_Bitmap : TBitmap; begin if (Action_Opt_LargeIcon.Checked) then begin if (ImageList_Icon.Width = lci_LARGE_ICON_SIZE) and (ImageList_Icon.Height = lci_LARGE_ICON_SIZE) then begin Exit; end; if (ImageList_LargeIcon.Count <> ImageList_Icon.Count) then begin ImageList_LargeIcon.Clear; l_Bitmap := TBitmap.Create; try for i := 0 to ImageList_Icon.Count -1 do begin l_Bitmap.Width := ImageList_Icon.Width; l_Bitmap.Height := ImageList_Icon.Height; l_Bitmap.Canvas.Brush.Color := clFuchsia; l_Bitmap.Canvas.FillRect(Rect(0, 0, l_Bitmap.Width, l_Bitmap.Height)); ImageList_Icon.GetBitmap(i, l_Bitmap); l_Bitmap.Width := ImageList_LargeIcon.Width; l_Bitmap.Height := ImageList_LargeIcon.Height; StretchBlt( l_Bitmap.Canvas.Handle, 0, 0, l_Bitmap.Width, l_Bitmap.Height, l_Bitmap.Canvas.Handle, 0, 0, ImageList_Icon.Width, ImageList_Icon.Height, SRCCOPY ); ImageList_LargeIcon.AddMasked(l_Bitmap, l_Bitmap.Canvas.Brush.Color); end; finally l_Bitmap.Free; end; end; end; if (Action_Opt_LargeIcon.Checked) then begin li_Height := lci_LARGE_BUTTON_SIZE; ToolBar_Main.Images := ImageList_LargeIcon; end else begin li_Height := lci_SMALL_BUTTON_SIZE; ToolBar_Main.Images := ImageList_Icon; end; li_Width := 0; ToolBar_Main.ButtonHeight := li_Height; ToolBar_Main.ButtonWidth := li_Width; Panel_ToolBar.Height := li_Height +1; FormResize(nil); end; procedure TApp_BugsEye.Action_Test_FlipNoneExecute(Sender: TObject); var l_Action : TAction; begin if (Sender is TMenuItem) then begin if (TMenuItem(Sender).Action = nil) then begin Exit; end; l_Action := TAction(TMenuItem(Sender).Action); end else if (Sender is TAction) then begin l_Action := TAction(Sender); end else begin Exit; end; l_Action.Checked := True; //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(l_Action); if (l_Action = Action_Test_FlipNone) then FrDispInfo.fpCapture_ZoomFlip := fpNone else if (l_Action = Action_Test_FlipHorizontal) then FrDispInfo.fpCapture_ZoomFlip := fpFlipHorizontal else if (l_Action = Action_Test_FlipVertical) then FrDispInfo.fpCapture_ZoomFlip := fpFlipVertical else if (l_Action = Action_Test_Rotate90) then FrDispInfo.fpCapture_ZoomFlip := fpRotate90 else if (l_Action = Action_Test_Rotate180) then FrDispInfo.fpCapture_ZoomFlip := fpRotate180 else if (l_Action = Action_Test_Rotate270) then FrDispInfo.fpCapture_ZoomFlip := fpRotate270; DrawNow; end; procedure TApp_BugsEye.Action_Opt_SelBkColorExecute(Sender: TObject); begin ColorDialog.Color := FrDispInfo.clOpt_BkColor; if (Sender = nil) or (ColorDialog.Execute) then begin FrDispInfo.clOpt_BkColor := ColorDialog.Color; FBitmapCopy.Canvas.Brush.Color := FrDispInfo.clOpt_BkColor; Action_Test_Brush_SolidExecute(Action_Test_Brush_Solid); FBitmapNoSelf.Canvas.Brush.Color := FrDispInfo.clOpt_BkColor; FBitmapDesktop.Canvas.Brush.Color := FrDispInfo.clOpt_BkColor; end; DrawNow; end; procedure TApp_BugsEye.Action_Test_Rop_SRCCOPYExecute(Sender: TObject); var l_Action : TAction; begin if (Action_Test_Rop_BLACKNESS.Tag <> BLACKNESS) then begin Action_Test_Rop_BLACKNESS.Tag := BLACKNESS; //物理パレットのインデックス0に対応する色(既定の物理パレットでは黒)でコピー先の長方形を塗りつぶします Action_Test_Rop_DSTINVERT.Tag := DSTINVERT; //コピー先長方形の色を反転します Action_Test_Rop_MERGECOPY.Tag := MERGECOPY; //論理AND演算子を使ってコピー元の色とコピー先の色を組み合わせます Action_Test_Rop_MERGEPAINT.Tag := MERGEPAINT; //論理OR演算子を使ってコピー元の色を反転した色とコピー先の色を組み合わせます Action_Test_Rop_NOTSRCCOPY.Tag := NOTSRCCOPY; //コピー元の色を反転してコピー先へコピーします Action_Test_Rop_NOTSRCERASE.Tag := NOTSRCERASE; //論理OR演算子を使ってコピー元の色とコピー先の色を組み合わせさらに反転します Action_Test_Rop_PATCOPY.Tag := PATCOPY; // Action_Test_Rop_PATINVERT.Tag := PATINVERT; // Action_Test_Rop_PATPAINT.Tag := PATPAINT; // Action_Test_Rop_SRCAND.Tag := SRCAND; //論理AND演算子を使ってコピー元の色とコピー先の色を組み合わせます Action_Test_Rop_SRCCOPY.Tag := SRCCOPY; //コピー元長方形をコピー先長方形へそのままコピーします Action_Test_Rop_SRCERASE.Tag := SRCERASE; //論理AND演算子を使ってコピー先の色を反転した色とコピー元の色を組み合わせます Action_Test_Rop_SRCINVERT.Tag := SRCINVERT; //論理XOR演算子を使ってコピー元の色とコピー先の色を組み合わせます Action_Test_Rop_SRCPAINT.Tag := SRCPAINT; //論理OR演算子を使ってコピー元の色とコピー先の色を組み合わせます Action_Test_Rop_WHITENESS.Tag := WHITENESS; //物理パレットのインデックス1に対応する色(既定の物理パレットでは白)でコピー先の長方形を塗りつぶします end; if (Sender = nil) or not(Sender is TAction) then begin Exit; end; l_Action := TAction(Sender); l_Action.Checked := True; FrDispInfo.iCapture_Rop := l_Action.Tag; //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(l_Action); DrawNow; end; procedure TApp_BugsEye.Action_Test_Brush_SolidExecute(Sender: TObject); var l_Action : TAction; l_BrushStyle : TBrushStyle; begin if (Sender = nil) or not(Sender is TAction) then begin Exit; end; l_Action := TAction(Sender); l_Action.Checked := True; if (l_Action = Action_Test_Brush_Solid) then begin l_BrushStyle := bsSolid end else if (l_Action = Action_Test_Brush_Clear) then begin l_BrushStyle := bsClear end else if (l_Action = Action_Test_Brush_Horizontal) then begin l_BrushStyle := bsHorizontal end else if (l_Action = Action_Test_Brush_Vertical) then begin l_BrushStyle := bsVertical end else if (l_Action = Action_Test_Brush_FDiagonal) then begin l_BrushStyle := bsFDiagonal end else if (l_Action = Action_Test_Brush_BDiagonal) then begin l_BrushStyle := bsBDiagonal end else if (l_Action = Action_Test_Brush_Cross) then begin l_BrushStyle := bsCross end else if (l_Action = Action_Test_Brush_DiagCross) then begin l_BrushStyle := bsDiagCross; end else begin l_BrushStyle := bsSolid; end; FBitmapCopy.Canvas.Brush.Style := l_BrushStyle; //ブラシの適用はFBitmapCopyだけ //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(l_Action); DrawNow; end; procedure TApp_BugsEye.Action_Test_Brush_BitmapExecute(Sender: TObject); var ls_File : WideString; begin if (gfnbOpenFileDialog(ls_File, '', Self.Handle)) then begin FBitmapBrush.LoadFromFile(ls_File); if (FBitmapBrush.Empty) then begin Exit; end; Action_Test_Brush_Bitmap.Checked := True; FBitmapCopy.Canvas.Brush.Bitmap := FBitmapBrush; //ラジオアイテム用のツールバーのボタンがトグル状態になってしまうことへの対処 FSetToolButtonDown(Action_Test_Brush_Bitmap); DrawNow; end; end; procedure TApp_BugsEye.Action_Test_Brush_SelColorExecute(Sender: TObject); var l_Action : TAction; begin if (Sender = nil) or not(Sender is TAction) then begin Exit; end; l_Action := TAction(Sender); ColorDialog.Color := l_Action.Tag; if (ColorDialog.Execute) then begin l_Action.Tag := ColorDialog.Color; if (l_Action = Action_Test_Brush_SelColor) then begin FBitmapCopy.Canvas.Brush.Color := ColorDialog.Color; end else if (l_Action = Action_Test_Brush_SelBkColor) then begin FrDispInfo.iTest_BrushBkColor := ColorToRGB(ColorDialog.Color); // Windows.SetBkColor(FBitmapCopy.Canvas.Handle, ColorToRGB(ColorDialog.Color)); // Windows.SetBkMode(FBitmapCopy.Canvas.Handle, OPAQUE); end; DrawNow; end; end; end.