如何用delphi制作一个edit显示血量?

来源:百度知道 编辑:UC知道 时间:2024/05/24 08:39:04
小弟刚看delphi, 不知从那里下手, 高手指点下 ,谢谢啊;
最好做个button能够刷新,这样在edit里显示(血值的格式"???/???"),
还有就是最好把button及edit的属性及事件也写一下;
客户端为"Element Client" ,当前血量地址为[[[Ox8f509c]+Ox20]+Ox450],最大血量地址为[[[Ox8f509c]+Ox20]+0x478].

1.如果窗体存在于注入游戏的dll中两个值可以这样表达
hp = pdword(pdword(pdword($8f509c)^ + $20)^ + $450)^
hpmax = pdword(pdword(pdword($8f509c)^ + $20)^ + $478)^
edit.text := format('%d / %d', [hp, hpmax])
把这些写入timer中就可以即时刷新

2.如果窗体没有注入游戏中可以用readprocessmemory来读取

3.如果dll已经注入游戏,窗体单独
可以在dll中读取该值后发送自定义消息给窗体,窗体接收消息后刷新显示
sendmessage(frm.handle, wm_user+1, 0, hp);
sendmessage(frm.handle, wm_user+1, 1, hpmax);