tips
[Top] [All Lists]

Minimizing and maximizing the MDI frame window

To: "REALbasic Tips" <realbasic-tips at lists dot realsoftware dot com>
Subject: Minimizing and maximizing the MDI frame window
From: Geoff Perlman <geoff at realsoftware dot com>
Date: Wed, 03 May 2000 11:21:06 -0500
When you build a Windows version of your REALbasic project, you can choose to build it using Multiple Document Interface. This means that there will be a single window (called a frame window) with a menu bar in which all other windows open. If the default size of the frame window is too small, the user can make it larger by clicking the Maximize icon for the window. However, there may be times when you want to maximize this window via code. You can
do this by making a Win32 API call. The following code does just that:

#if TargetWin32 then
dim i as integer

declare function ShowWindow Lib "user32.dll" Alias "ShowWindow"(byVal hwnd
as integer, byVal type as integer) as integer
declare function GetForegroundWindow Lib "user32.dll" Alias
"GetForegroundWindow" as integer

i = ShowWindow(GetForegroundWindow(),3)
#endif

Note: The two lines beginnning with "declare" have probably been split into two lines due to their length so you will need to put them back together to
use the code.

The second parameter (3) passed to ShowWindow indicates that you want to
maximize the window. Passing 2 as the second parameter will minimize the
window.

This tip was inspired by Petur J. Skulason.
--

Geoff Perlman
President & CEO
REAL Software, Inc.
http://www.realsoftware.com
mailto:geoff at realsoftware dot com
Phone: 512-263-1233 x711
Fax:   512-263-1441



 - - - - - - - - - -
Got a useful tip to share? Send it to us at:
REALbasic-tips at lists dot realsoftware dot com dot
For list commands, send "Help" in the body of a message to
<requests at lists dot realsoftware dot com>



<Prev in Thread] Current Thread [Next in Thread>
  • Minimizing and maximizing the MDI frame window, Geoff Perlman <=