🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ShellExecute

#17114
From: Remy Lebeau (TeamB)
Date: Wed, 09 Apr 2003 17:04
27 lines
1992 bytes
"Keneth Wagner" <Keneth_w@msn.com> wrote in message
news:3e93e3bd$1@newsgroups.borland.com...

> I call that program with SellExecute and opttain an
> HINSTANCE  variable to the program.

The HINSTANCE returned by ShellExecute() is not a valid HINSTANCE, as stated
in Microsoft's own documentation:

    Return Value
        Returns a value greater than 32 if successful, or an error value
that is less than or equal to 32 otherwise. The following table lists the
error values. The return value is cast as an HINSTANCE for backward
compatibility with 16-bit Windows applications. It is not a true HINSTANCE,
however. The only thing that can be done with the returned HINSTANCE is to
cast it to an int and compare it with the value 32 or one of the error codes
below.

> how to optain the handle of that other window?.

Use CreateProcess() instead.  It returns a process ID, which you can then
use with EnumWindows() and GetWindowThreadProcessId() to find any windows
that have a matching process ID.


Gambit
Technical Details
Message-ID: <3e945287$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.news2me.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3e93e3bd$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,bff1fa0e8e8777f2
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-09 10:16:02 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3e93e3bd$1@newsgroups.borland.com>
Subject: Re: ShellExecute
Date: Wed, 9 Apr 2003 10:04:27 -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: <3e945287$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1049907847 207.175.226.26 (9 Apr 2003 10:04:07 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.news2me.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail