Log in

View Full Version : Flat button in Delphi


CccT
July 2nd, 2002, 16:05
Xplorex is a simple program that is essentially an additional start button in the top left corner. It's gray, without icon yet.

What and where must be added so that the button will stay flat on mousedown and mouseclick without a 3D border ?

object Form1: TForm1
Left = 0
Top = 0
BorderStyle = bsNone
Width = 32
Height = 32
OnCreate = FormCreate
Visible = False
object dirtree1: Tdirtree
Visible = False
end
object SecretPanel1: TSecretPanel
Left = 0
Top = 0
BorderStyle = bsNone
Width = 32
Height = 32
object RxSpeedButton1: TRxSpeedButton
Left = 0
Top = 0
Width = 32
Height = 32
Flat = True
OnClick = RxSpeedButton1Click
end
end
object FormStorage1: TFormStorage
end
end

XploreX :
http://www.exetools.com/forum/attachment.php?s=&postid=3248

Kayaker
July 3rd, 2002, 02:43
Hi,

That looks like it will be a handy little Delphi program when you get it finished, I see you've got your question answered on the other forum, looking forward to the final result.

I've looked and looked and can't see much project potential here, except for one important thing - this is a very small Delphi app - which makes it great for looking at the structural aspects of Delphi and how they are built into the PE file. It is difficult to reverse a Delphi app because the creation and look of most controls are handled on the fly in code. Access to the variables isn't as free in Delphi I find, it's difficult to patch in a few bytes or modify a variable without affecting something further on in the Delphi bloat (this simple 1 button app of 314Kb will attest to the bloat!

But you can make certain resource modifications if you're very careful. Even something like making an invisible control appear by modifying the PE file takes a little bit of study to see what bytes need to be changed. Making a more major change like making a control INvisible can cause problems because in theory you are supposed to ADD a line to the PE file - (Visible = False), but you can't do this without affecting the rest of the RCDATA form structure. You can use ResHack to recompile modified resource data, but a manual understanding of the Delphi structure can be useful.

You can sometimes sacrifice other components by using their space to add or change new features, for example, bitmaps are coded into the PE file as Glyph.Data and immediately follow the rest of the forms' Property values. They can be resized (smaller) so you could in theory use this space for adding any possible modifications and perhaps as a "cave" for patch code.


Other than that, I can't see much going on here unless someone has anything to say. The moderator can handle the post at his discretion ;->>

Cheers,
Kayaker

CccT
July 3rd, 2002, 11:52
I started with Delphi about six month ago, so switching to C++ wouldn't be a good idea for the time being. Maybe in the future.
This proggy is just a part of a suite of desktop gadgets.
I'll post another C proggy later today.

CccT

ZaiRoN
July 3rd, 2002, 13:51
hey Kayaker!
you have read my thoughts ;p
indeed, delphi programs are not easy to reverse...
sorry but i can't see nothing more to do with this proggie

if i remember well, i haven't seen a delphi pe/resource project in this area and could be an interesting idea!
at first, i prefer something like basically stuff for understand how the resource are stored and how you can modify them; after that we can try to do some hard projects...
i don't code in delphi but if someone do it (crusader, where are you? ) and want to make a little program, here we are!

i would like to suggest an interesting reference:
http://www.woodmann.net/fravia/dafix_t1.htm
it's a must...read it with much attention!

just my 2c...
ciao,
ZaiRoN

tHE SnaKe
July 4th, 2002, 12:36
look this:
use speed button in delphi i'ts easy
after using speed button
goto speedbutton & search flat u find False change to
true
delphiCooool!!