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] Form Always On Top problem

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

Joined: 17 Jan 2007
Posts: 185
Location: The Netherlands

PostPosted: Mon Dec 31, 2007 1:10 pm    Post subject: [Delphi] Form Always On Top problem Reply with quote

Ok, I have 2 forms. On Form1, I have a button which makes Form2 visible. I want Form2 to be 'Always On Top' but when I do that I can't click anything on Form1.

Code:
Form2.Create(Self);
//Form2.Show; //This makes it clickable but doesn't make it Always On Top
Form2.Showmodal;
SetWindowPos(Form2.Handle,
             HWND_TOPMOST,
             0,
             0,
             0,
             0,
             SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE); //Or "Form2.FormStyle := fsStayOnTop;"
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 473

Joined: 09 May 2003
Posts: 25910
Location: The netherlands

PostPosted: Mon Dec 31, 2007 1:42 pm    Post subject: Reply with quote

do form2.show instead of form2.showmodal;
followed by setwindowpos


and form2.formstyle:=fsStayOnTop; works too

_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
GuM
Expert Cheater
Reputation: 0

Joined: 17 Jan 2007
Posts: 185
Location: The Netherlands

PostPosted: Mon Dec 31, 2007 2:28 pm    Post subject: Reply with quote

I already tried that. It only makes Form2 stay on top of Form1. I want it to stay on top of other programs too.
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Mon Dec 31, 2007 9:05 pm    Post subject: Reply with quote

Then use SetWindowPos.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Tue Jan 01, 2008 2:37 am    Post subject: Reply with quote

button1:

form2.show; (form2.onshow, form2.formstyle:=fsstayontop;)

edit: don't forget

form2.onclose, form2.formstyle:=fsnormal;)
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Tue Jan 01, 2008 7:20 am    Post subject: Reply with quote

Just pot the next command in a Timer:
Code:
SetWindowPos(Form2.Handle,
             HWND_TOPMOST,
             0,
             0,
             0,
             0,
             SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);
Back to top
View user's profile Send private message
GuM
Expert Cheater
Reputation: 0

Joined: 17 Jan 2007
Posts: 185
Location: The Netherlands

PostPosted: Tue Jan 01, 2008 7:34 am    Post subject: Reply with quote

HolyBlah wrote:
Just pot the next command in a Timer:
Code:
SetWindowPos(Form2.Handle,
             HWND_TOPMOST,
             0,
             0,
             0,
             0,
             SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);


Works, Thanks Wink
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