求教:我写的Ollydbg/x36dbg贴心伴侣浮动工具栏边缘隐藏有个bug
本帖最后由 冥界3大法王 于 2021-2-19 13:19 编辑如图1所示,移到边缘没啥问题,
如图2所示,如移了之后,那个浮动工具栏的宽 和 高 ,就会变化了,如何各得其安?
procedure TForm1.FormCreate(Sender: TObject);
var
x: integer;
begin
//SetWindowLong(handle, gwl_style, getwindowlong(handle, gwl_style) xor ws_caption); //去标题栏
Form1.Width := 765;
Form1.Height := 658;
ToolBar2.Height := 55;
ToolBar2.Width := 313;
SetWindowPos(Handle, HWND_TOPMOST, Left, Top, Width, Height, SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE); //窗口置顶
//Form1.color := clWhite;
//Form1.TransparentColorValue := clWhite;
//Form1.TransparentColor := True;
{
显示窗口类:
CPU窗口: Alt+C
断点窗口:Alt+B
内存窗口:Alt+M
日志窗口:Alt+L
堆栈窗口:Alt+K
模块窗口/API调用:Alt+E/Ctrl+N
引用:Alt+R
句柄:Alt+W
流程图:Alt+G
线程:Alt+T=======>有问题
脚本:Alt+S/Ctrl+Alt+S=======>有问题
函数Ctrl+Alt+F======>有问题
============================
自定义命令:
Shift+Q 清空CC断点
Ctrl+Shift+Q 清空硬件断点
Ctrl+Shift+Alt+Q 清空内存断点
==============================
Ctrl+H 脱壳时下硬件访问断点时使用。bph 005B7C20,r,2
Ctrl+Shift+1 设置硬件1字节访问断点
Ctrl+Shift+2 设置硬件2字节访问断点
Ctrl+Shift+3 设置硬件4字节访问断点
Ctrl+Shift+4 设置硬件8字节访问断点(仅x64dbg)
Ctrl+Shift+5设置硬件1字节写入断点
Ctrl+Shift+6设置硬件2字节写入断点
Ctrl+Shift+7设置硬件4字节写入断点
Ctrl+Shift+8设置硬件8字节写入断点 (仅x64dbg)
Ctrl+Shift+9 设置硬件执行断点
Win+Num1 设置一性次内存访问断点等价rw
Win+Num2 设置一性次内存读取断点等价r
Win+Num3 设置一性次内存写入断点等价w
Win+NumDot 设置一性次内存执行断点等价x
Win+S 访问《Ollydbg/x36dbg贴心助手》主窗口▲★▲
Alt+A目标窗口中按(譬如,亲爱的妹子.exe),得到目标窗口进程的PID,回到命令行处粘即可附加
Ctrl+Shift+G一键定位RVA(x64dbg顶部标题上按)
Alt+Shift+G一键定位FOA(x64dbg顶部标题上按)
Ctrl+Shift+T在x32dbg窗口标题处点击得到x32dbg/x64dbg的完整路径,转换后打开x32dbg.ini/x64dbg.ini
Shift+F2 禁用当前行的F2/CC断点
Ctrl+Shift+J 得到模块基址(在标题按)
}
id2 := GlobalAddAtom('hotkey2');
RegisterHotKey(handle, id2, MOD_CONTROL + MOD_SHIFT, 84); //ctrl+shift+t
id4 := GlobalAddAtom('hotkey4');
RegisterHotKey(handle, id4, MOD_WIN, 83); //Window+S
id8 := GlobalAddAtom('hotkey8');
RegisterHotKey(handle, id8, MOD_WIN, 81); //Window+Q 退出程序
id_A1 := GlobalAddAtom('hotkey_id_A1');
RegisterHotKey(handle, id_A1, MOD_CONTROL + MOD_SHIFT, 49); //ctrl+shift+1
id_A2 := GlobalAddAtom('hotkey_id_A2');
RegisterHotKey(handle, id_A2, MOD_CONTROL + MOD_SHIFT, 50); //ctrl+shift+2
id_A3 := GlobalAddAtom('hotkey_id_A3');
RegisterHotKey(handle, id_A3, MOD_CONTROL + MOD_SHIFT, 51); //ctrl+shift+3
id_A4 := GlobalAddAtom('hotkey_id_A4');
RegisterHotKey(handle, id_A4, MOD_CONTROL + MOD_SHIFT, 52); //ctrl+shift+4
id_A5 := GlobalAddAtom('hotkey_id_A5');
RegisterHotKey(handle, id_A5, MOD_CONTROL + MOD_SHIFT, 53); //ctrl+shift+5
id_A6 := GlobalAddAtom('hotkey_id_A6');
RegisterHotKey(handle, id_A6, MOD_CONTROL + MOD_SHIFT, 54); //ctrl+shift+6
id_A7 := GlobalAddAtom('hotkey_id_A7');
RegisterHotKey(handle, id_A7, MOD_CONTROL + MOD_SHIFT, 55); //ctrl+shift+7
id_A8 := GlobalAddAtom('hotkey_id_A8');
RegisterHotKey(handle, id_A8, MOD_CONTROL + MOD_SHIFT, 56); //ctrl+shift+8
id_A9 := GlobalAddAtom('hotkey_id_A9');
RegisterHotKey(handle, id_A9, MOD_CONTROL + MOD_SHIFT, 57); //ctrl+shift+9
///////////////////////////////////////////////////////////////////////////////////////////////
id_Num1 := GlobalAddAtom('hotkey-id_Num1');
RegisterHotKey(handle, id_Num1, MOD_WIN, 97); //Win+Num1
id_Num2 := GlobalAddAtom('hotkey-id_Num2');
RegisterHotKey(handle, id_Num2, MOD_WIN, 98); //Win+Num2
id_Num3 := GlobalAddAtom('hotkey-id_Num3');
RegisterHotKey(handle, id_Num3, MOD_WIN, 99); //Win+Num3
id_NumDot := GlobalAddAtom('hotkey-id_NumDot');
RegisterHotKey(handle, id_NumDot, MOD_WIN, 110); //Win+NumDot
ID_G := GlobalAddAtom('hotkey-ID_G');
RegisterHotKey(handle, id_A9, MOD_CONTROL + MOD_SHIFT, 71); //Ctrl+Shift+G
ID_AltA := GlobalAddAtom('hotkey-ID_AltA');
RegisterHotKey(handle, ID_AltA, MOD_ALT, 65); //Alt+A 附加进程
ID_AltShiftG := GlobalAddAtom('hotkey-ID_AltShiftG');
RegisterHotKey(handle, ID_AltShiftG, MOD_ALT + MOD_SHIFT, 71); //Alt+Shift+G
ID_CtrlH := GlobalAddAtom('hotkey-ID_CtrlH');
RegisterHotKey(handle, ID_CtrlH, MOD_CONTROL, 72); //Ctrl+H
ID_ShiftF2 := GlobalAddAtom('hotkey-ShiftF2'); //Shift+F2 禁用CC断点
RegisterHotKey(handle, ID_ShiftF2, +MOD_SHIFT, VK_F2);
ID_CtrlShiftJ := GlobalAddAtom('hotkey-ID_CtrlShiftJ');
RegisterHotKey(handle, id_A9, MOD_CONTROL + MOD_SHIFT, 74); //ctrl+shift+j
begin
Timer1.Enabled := False;
Timer1.Interval := 200;
FormStyle := fsStayOnTop;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject); //屏幕边缘时显示窗体效果
const
cOffset = 2;
var
vHandle: THandle;
begin
vHandle := WindowFromPoint(Mouse.CursorPos);
while (vHandle <> 0) and (vHandle <> Handle) do
vHandle := GetParent(vHandle);
if vHandle = Handle then
begin
if akLeft in FAnchors then
Left := 0;
if akTop in FAnchors then
Top := 0;
if akRight in FAnchors then
Left := Screen.Width - Width;
if akBottom in FAnchors then
Top := Screen.Height - Height;
end
else
begin
if akLeft in FAnchors then
Left := -Width + cOffset;
if akTop in FAnchors then
Top := -Height + cOffset;
if akRight in FAnchors then
Left := Screen.Width - cOffset;
if akBottom in FAnchors then
Top := Screen.Height - cOffset;
end;
end;
procedure TForm1.WMMOVING(var Msg: TMessage); //屏幕边缘时显示窗体效果
begin
inherited;
with PRect(Msg.LParam)^ do
begin
Left := Min(Max(0, Left), Screen.Width - Width);
Top := Min(Max(0, Top), Screen.Height - Height);
Right := Min(Max(Width, Right), Screen.Width);
Bottom := Min(Max(Height, Bottom), Screen.Height);
FAnchors := [];
if Left = 0 then
Include(FAnchors, akLeft);
if Right = Screen.Width then
Include(FAnchors, akRight);
if Top = 0 then
Include(FAnchors, akTop);
if Bottom = Screen.Height then
Include(FAnchors, akBottom);
Timer1.Enabled := FAnchors <> [];
end;
end; 看着真不错哦 AutoHotkey开发的吗? redapple2015 发表于 2021-2-19 10:35
AutoHotkey开发的吗?
@redapple2015
用这个开发几百个模块你试试,后期控件调整不得神经? 窗口风格好像有个固定模式…设置为真,大小就不可变了…不晓得适合delphi不 本帖最后由 冥界3大法王 于 2021-2-19 16:44 编辑
无闻无问 发表于 2021-2-19 15:31
窗口风格好像有个固定模式…设置为真,大小就不可变了…不晓得适合delphi不
试过,无效。 我感觉是不是时钟事件,窗体移动事件,窗体创建事件中设置窗体的大小相关代码不吻合,检查调试下下 我也喜欢给不同软件贴上不同图标{:1_893:} emmm,大佬,咋下你的工具呢? 软件没有下载地址,如果付费,我愿意花钱买这个
页:
[1]