Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Delphi question

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Sun Mar 23, 2008 8:27 pm    Post subject: Delphi question Reply with quote

how do you make it so you can't maximize a form?

I make something small, and I don't want people to be able to maximize because it looks funky cause the background doesn't stretch. Laughing

_________________
LAWLrrenzolicious
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Mar 24, 2008 2:21 am    Post subject: Reply with quote

you can either make the form have no caption bar, which is easy, or you can disable the maximize button which i think works like this:

Code:
Form1.BorderIcons := Form1.BorderIcons - [biMaximize];

put that before the rest of your code, in form load or something

_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Mar 24, 2008 3:45 am    Post subject: Reply with quote

Or you can make a fixed dialog border style.

Snootae wrote:
you can either make the form have no caption bar, which is easy, or you can disable the maximize button which i think works like this:

Code:
Form1.BorderIcons := Form1.BorderIcons - [biMaximize];

put that before the rest of your code, in form load or something

He could do that through the properties and then you can still resize.

You could always make the image stretch.
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Mon Mar 24, 2008 4:35 am    Post subject: Reply with quote

Well, I did just mess with this yesterday.
You can "hook" the maximize message and change it so it does nothing.
Like that:
Code:
  private
    procedure MenuHook(var Msg:TMessage); message WM_SYSCOMMAND;
  public
    {...}


And:

Code:
procedure TForm1.MenuHook(var Msg:TMessage);
begin
  if Msg.wParam = SC_Maximize then
  begin
     Msg.WParam := 0;
  end;

  inherited;
end;


I made this yesterday to hook the Close message (when you click on the X on the bar) and changed the wParam to SC_Minimize.

(I didn't test it, but it should work)
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Mar 24, 2008 5:50 am    Post subject: Reply with quote

yeh, symbol, but for some reason i cant edit it in the properties tab thingy, dunno why, but how does that code make it so you cant resize? it should just make it without maximize

woah reak, thats nice, i remember trying to do something like that cos i found the draggable form code which was similar, could you make it so if you clicked an image, it would make it so it was actually clicking a button or something, that would be really handy

_________________
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Mon Mar 24, 2008 6:18 am    Post subject: Reply with quote

Snootae wrote:
woah reak, thats nice, i remember trying to do something like that cos i found the draggable form code which was similar, could you make it so if you clicked an image, it would make it so it was actually clicking a button or something, that would be really handy


You mean, changing the OnClick procedure of an Image/Button ?
Or a adding a OnClick procedure to an Image?
Back to top
View user's profile Send private message
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Mon Mar 24, 2008 7:22 pm    Post subject: Reply with quote

Snootae wrote:
you can either make the form have no caption bar, which is easy, or you can disable the maximize button which i think works like this:

Code:
Form1.BorderIcons := Form1.BorderIcons - [biMaximize];

put that before the rest of your code, in form load or something


Thanks a lot. Works like a charm.

_________________
LAWLrrenzolicious
Back to top
View user's profile Send private message
Snootae
Grandmaster Cheater
Reputation: 0

Joined: 16 Dec 2006
Posts: 969
Location: --->

PostPosted: Mon Mar 24, 2008 9:41 pm    Post subject: Reply with quote

nps, btw reak i meant so you press the image, and its changes it to button.click or something, could you help me?
_________________
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Mar 25, 2008 4:08 am    Post subject: Reply with quote

You mean, you want to call Button.Click?
So Button1.Click;? Surprised
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Tue Mar 25, 2008 4:08 am    Post subject: Reply with quote

Snootae wrote:
nps, btw reak i meant so you press the image, and its changes it to button.click or something, could you help me?


You could just set the OnClick event of the image to the procedure of the button.
Or do you mean changing the OnClick event in OnClick ?
I don't really get your problem.
But with that
Code:
Image1.OnClick := Button1Click;


You can change the OnClick procedure of the Image while the program is running.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Tue Mar 25, 2008 5:10 am    Post subject: Reply with quote

Smile


HeCanAlsoDoThis.PNG
 Description:
 Filesize:  12.16 KB
 Viewed:  4832 Time(s)

HeCanAlsoDoThis.PNG


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites