🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Running an external application like a modal form

#12714
From: Remy Lebeau (TeamB)
Date: Sat, 22 Nov 2003 00:00
18 lines
1859 bytes
"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: <3fbea647$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!news-out.visi.com!petbe.visi.com!green.readfreenews.net!news.readfreenews.net!news-xfer.cox.net!peer01.cox.net!cox.net!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3fbea2f3$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-21 16:01:30 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3fbea2f3$1@newsgroups.borland.com>
Subject: Re: Running an external application like a modal form
Date: Fri, 21 Nov 2003 16:00:49 -0800
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.137.149
Message-ID: <3fbea647$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069459015 67.22.137.149 (21 Nov 2003 15:56:55 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!news-out.visi.com!petbe.visi.com!green.readfreenews.net!news.readfreenews.net!news-xfer.cox.net!peer01.cox.net!cox.net!border3.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail