Article View: borland.public.cppbuilder.nativeapi
Article #12632Re: Running an external application like a modal form
From: Damian Vilchis
Date: Mon, 24 Nov 2003 18:18
Date: Mon, 24 Nov 2003 18:18
39 lines
2362 bytes
2362 bytes
Thanks Remy, The problem with both aproaches is that not only the paint message is processed. If I use ProcessMessages, any message is processed and this eliminate the Modal behavior. Update work a little better, only repaint the form, but the messages are enqueued, and when the external application terminate these are executed. I need a more accurate reproduction of the modal behavior, tha calling application must be able to paint itself but not anymore. Maybe WaitForsingleObject is not the way to go ? Thanks. Remy Lebeau (TeamB) wrote: > "Damian Vilchis" <damian@ininin.com.mx> wrote in message > news:3fbea2f3$1@newsgroups.borland.com... > >>I want to run an external application like a modal form. I'm using >>the ShellExecuteEx and the WaitForSingleObject windows api >>functions, but in this way the main window (GUI) is not repainted. > > > Are you specifying INFINITE for the timeout of WaitForSingleObject()? If > so, then specify an actual timeout value, such as 500, and then call it is a > loop that also calls Application->ProcessMessages() or at least Update(), > ie: > > while( WaitForSingleObject(ShellInfo.hProcess, 500) == WAIT_TIMEOUT ) > Application->ProcessMessages(); > // or MyForm->Update(); > > > Gambit > >
Technical Details
Message-ID:
<3fc24ad9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3fbea2f3$1@newsgroups.borland.com> <3fbea647$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2cd4433069f943cd X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-11-24 10:40:03 PST Date: Mon, 24 Nov 2003 12:18:39 -0600 From: Damian Vilchis <damian@ininin.com.mx> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6a) Gecko/20031030 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Running an external application like a modal form References: <3fbea2f3$1@newsgroups.borland.com> <3fbea647$1@newsgroups.borland.com> In-Reply-To: <3fbea647$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 148.235.169.11 Message-ID: <3fc24ad9$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1069697753 148.235.169.11 (24 Nov 2003 10:15:53 -0700) Lines: 39 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail