🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #17209

Re: programma's sluiten in visual basic

#17209
From: Frits van Bommel
Date: Thu, 27 Jan 2000 00:00
33 lines
2005 bytes
Steven Wuyts <wuyts.steven@pandora.be> schreef in berichtnieuws
F_%j4.2239$CP1.18338@afrodite.telenet-ops.be...
> Hallo,
>
> een klein visual basic-vraagje : als je een programma opent in visual
basic
> (bvb met het shell commando), hoe sluit je het dan ook weer af  (het
> programma dat geopend is moet terug gesloten worden vanuit visual basic) ?

Het volgende komt rechtstreeks uit de VB 3.0 helpfile (example bij shell, te
pasten in Form_Click() )
Ik hoop dat je er wat aan hebt.

    Frits van Bommel

Dim I, X, Msg ' Declare variables.
 AppActivate "Microsoft Visual Basic" ' Change focus to Visual Basic.
 SendKeys "%{ }{Down 3}{Enter}", True ' Minimize Visual Basic.
 X = Shell("Calc.exe", 1) ' Shell Calculator.
 For I = 1 To 100 ' Set up counting loop.
  SendKeys I & "{+}", True ' Send keystrokes to Calculator

Next I ' to add each value of I.

SendKeys "=", True ' Get grand total.
 AppActivate "Microsoft Visual Basic" ' Return focus to Visual Basic.
 Msg = "Choose OK to close the Calculator.
 MsgBox Msg ' Display OK prompt.
 AppActivate "Calculator" ' Return focus to Calculator.
 SendKeys "%{F4}", True ' Alt+F4 to close Calculator.
 AppActivate "Microsoft Visual Basic" ' Return focus to Visual Basic.
 SendKeys "%{ }{Enter}", True ' Restore Visual Basic to size.
Technical Details
Message-ID: <86q549$32dmf$1@reader2.wxs.nl>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <F_%j4.2239$CP1.18338@afrodite.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcea4,b66cfe222f1a7336
X-Google-Attributes: gidfcea4,public
From: "Frits van Bommel" <NotAChance@No.Spam>
Subject: Re: programma's sluiten in visual basic
Date: 2000/01/27
Message-ID: <86q549$32dmf$1@reader2.wxs.nl>
X-Deja-AN: 578425351
References: <F_%j4.2239$CP1.18338@afrodite.telenet-ops.be>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: abuse@wxs.nl
X-Trace: reader2.wxs.nl 949000137 3225295 195.121.159.38 (27 Jan 2000 19:08:57 GMT)
Organization: Planet Internet
X-MSMail-Priority: Normal
NNTP-Posting-Date: 27 Jan 2000 19:08:57 GMT
Newsgroups: be.comp.programming