Solved

Application.ProcessMessages method...

Posted on 1998-09-13
5
172 Views
Last Modified: 2010-04-06
Hi

I have a loop in a form (say Form1) that goes:
 
  while True do
    Application.ProcessMessages;

This allows others things to happen at the same time BUT when I open a MODAL form (ie using Form2.ShowModal), I can't close the form. The OnClose event will not take place unless I terminate the loop in Form1.

How do I solve this problem?, ie to be able to open and close Form2 (as a modal form) with the loop still running in Form1.

Regards
Keith
0
Comment
Question by:keithcsl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 1

Author Comment

by:keithcsl
ID: 1339629
Edited text of question
0
 
LVL 3

Expert Comment

by:Matvey
ID: 1339630
Try maybe Application.HandleMessaage?
0
 
LVL 10

Accepted Solution

by:
viktornet earned 70 total points
ID: 1339631
use this inside your loop.........

break;
//close the form
continue;

Regards,
Viktor Ivanov
0
 
LVL 1

Author Comment

by:keithcsl
ID: 1339632
viktornet

thank you for your answer.

Regards
Keith
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339633
No prob :-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question