Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to position maximized forms Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
30-Aug-02
Category
Others
Language
Delphi 2.x
Views
44
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

I am working on a project that must keep the 640x480 pixel screen size. I would 
like to make it MDI. I've designed a small form with a menu and a tool bar (like 
Delphi's IDE). The user will click on this IDE like form and a new window will be 
display. Here is the problem: When the user maximizes this window, it goes to (0,0) 
thus hiding IDE form.

Answer:

Handle WM_GETMINMAXINFO, that allows you to specify position and size of the 
maximized window:


private
1   { Private declarations }
2   
3   procedure WMGetMinMaxInfo(var msg: TWMGetMinmaxInfo); message WM_GETMINMAXINFO;
4   
5   procedure TForm2.WMGetMinMaxInfo(var msg: TWMGetMinmaxInfo);
6   var
7     r: TRect;
8   begin
9     inherited;
10    SystemParametersInfo(SPI_GETWORKAREA, 0, @r, 0);
11    r.top := Application.Mainform.Height + Application.Mainform.Top;
12    with msg.MinMaxInfo^.ptMaxSize do
13    begin
14      x := r.right - r.left;
15      y := r.bottom - r.top;
16    end;
17    msg.Minmaxinfo^.ptmaxPosition := r.TopLeft;
18  end;



This code will make the form use the full available screen area (minus taskbar) under the main form, you will need to modify it to limit it to a maximum of 640x480.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC