🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #11229

How to make a window modal

#11229
From: Martin Golm
Date: Fri, 20 Feb 2004 15:27
24 lines
1509 bytes
Moving off of OWL I created my own window class hierarchy. Everything
works okay for now, but I have not yet figured out one thing: how to
make a window modal.
Lets say, I'd like to create a print preview window, or some kind of an
options dialog. Of course, such kind of windows should be modal. How can
this be done? Simply by adding a
GetMessage/TranslateMessage/DispatchMessage-loop like the following?

void tPrintPreview :: ShowModal()
{
  Show(); //base class' Show() 
  MSG msg;
  while (::GetMessage(&msg, 0, 0, 0))
  {
    ::TranslateMessage(&msg);
    ::DispatchMessage(&msg);
  }
}

Is it just this? If not, how else to do it?


Thanks in advance,
Martin
Technical Details
Message-ID: <4036276C.5E202C7F@gmx.de>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,214f35d58464ad5,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-02-20 07:40:22 PST
Message-ID: <4036276C.5E202C7F@gmx.de>
Date: Fri, 20 Feb 2004 16:27:40 +0100
From: Martin Golm <golm@gmx.de>
X-Mailer: Mozilla 4.72 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to make a window modal
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 62.158.112.8
X-Trace: newsgroups.borland.com 1077290848 62.158.112.8 (20 Feb 2004 07:27:28 -0800)
Lines: 25
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail