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 


[SOLVED!] manoeuvre a form with TImage

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sun Dec 07, 2008 4:50 am    Post subject: [SOLVED!] manoeuvre a form with TImage Reply with quote

Just wondering if anyone can share some info on how this would work. What I want to do is use TImage to manoeuvre my form just like a caption bar would.




Notice the typo in the screenie

Discuss,

_________________


Last edited by angerist on Mon Dec 08, 2008 12:07 am; edited 1 time in total
Back to top
View user's profile Send private message
bartil
Advanced Cheater
Reputation: 0

Joined: 11 Jul 2006
Posts: 91

PostPosted: Sun Dec 07, 2008 7:15 am    Post subject: Reply with quote

Code:
ReleaseCapture;
SendMessage(Handle,WM_SYSCOMMAND,61458,0);


put it in your image's mouse down event...
Back to top
View user's profile Send private message MSN Messenger
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Sun Dec 07, 2008 7:16 am    Post subject: Reply with quote

Code:
procedure TForm.OnMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
if Button = mbLeft then
begin
  SetCaptureControl(nil);
  Perform(wm_SysCommand, sc_Move or 1, 0);
end;
end;
Back to top
View user's profile Send private message
angerist
Grandmaster Cheater Supreme
Reputation: 0

Joined: 18 Jun 2007
Posts: 1011
Location: Australia.

PostPosted: Sun Dec 07, 2008 10:10 pm    Post subject: Reply with quote

First method didn't work. Not sure about 2nd .

EDIT:

I found this info on the net. But This doesn't support components. So all I can do with my form is move it around. Buttons ect ect don't work.




1. insert the following line into your form's "Private declarations" section (message handling procedure declaration):
Code:

procedure WMNCHitTest(var Msg: TWMNCHitTest);
  message wm_NCHitTest;


2. add the following code into the "implementation" section of your form's unit (where Form1 is assumed form name):

Code:
procedure TForm1.WMNCHitTest(var Msg: TWMNCHitTest);
begin
  inherited;
  if  Msg.Result = htClient then
    Msg.Result := htCaption;
end;

_________________
Back to top
View user's profile Send private message
Wintermoot
Expert Cheater
Reputation: 0

Joined: 08 Nov 2007
Posts: 198

PostPosted: Mon Dec 08, 2008 6:02 am    Post subject: Reply with quote

I just tested. All the codes posted work. The final method using WMNCHitTest is inadvisable as it removes all mouse events.

I suggest you use Reak's source since, that also allows you to add right-click functionality to the 'caption bar'...

I suggest you google before making a thread. The first result on google when searching for 'Delphi move form without caption' would have solved your problem.
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