🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: was ShellExecute - crash on NT4

#16858
From: Remy Lebeau (TeamB)
Date: Tue, 22 Apr 2003 17:30
27 lines
2291 bytes
"Murray Nelson" <mnpicker@agt.net> wrote in message
news:3EA4F142.2040002@agt.net...

>   Actually I have been using ShellExecuteInfo
> I am trying to write a registry key to the registry with
> a file suffixed .reg previously prepared. ShellExecuteInfo
> works great except I get "Are you sure ..." and then I get
> "...successfuly entered into registry". So I have to complete
> a carriage return twice or a space bar twice to get the
> final result. What can I put into the
>  ExecInfo.lpParameters = ""; to complete the spacebar
> strokes?

You can't send keyboard strokes with ShellExecute().  Nor can you pass
parameters to REGEDIT.EXE because you're only specifying a filename and not
the actual application as well, thus the lpParameters value is ignored
completely.  You could, however, use keybd() for sending the keystrokes.

However, either way, you should instead be calling REGEDIT.EXE directly,
passing it the .reg filename as a parameter as well as the /S flag.  That
will prevent the message boxes from being displayed in the first place.   In
which case, I would suggest you use CreateProcess() instead of
ShellExecuteEx() for that.


Gambit
Technical Details
Message-ID: <3ea57be7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3ea04c39$1@newsgroups.borland.com> <3EA47744.4010906@agt.net> <3ea4809d$1@newsgroups.borland.com> <3EA4C5ED.5050505@agt.net> <3ea4e282$1@newsgroups.borland.com> <3EA4F142.2040002@agt.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5c247afc24d17dcf
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-22 10:32:06 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3ea04c39$1@newsgroups.borland.com> <3EA47744.4010906@agt.net> <3ea4809d$1@newsgroups.borland.com> <3EA4C5ED.5050505@agt.net> <3ea4e282$1@newsgroups.borland.com> <3EA4F142.2040002@agt.net>
Subject: Re: was  ShellExecute - crash on NT4
Date: Tue, 22 Apr 2003 10:30:08 -0700
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3ea57be7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1051032551 207.175.226.26 (22 Apr 2003 10:29:11 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail