🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: (ATTN: Remy) Find window handle from exe file name

#13083
From: Ed Mulroy [TeamB]
Date: Sun, 26 Oct 2003 01:08
47 lines
2515 bytes
I have no idea what you're doing there.  You say you used the WindowFromFile
function and, other than the code you show, nothing else in the program
pertains to this problem.

Where in the code did you close IE?  Why would you expect the IE window to
close if you didn't close it?

.  Ed

> Martin C wrote in message
> news:3f9af35c@newsgroups.borland.com...
>
> Thank you for your reply, actually I solved the Error I
> was receiving. Now after compiling the project correctly
> and running it, I tried to execute the following code but
> unfortunately nothing happened and the opened IE
> windows remained visible...so can you tell me please
> what I am missing here..
>
> P.S. The rest of the code you provided in the attachment
> I left it *as is*
>
> void __fastcall TForm2::Button1Click(TObject *Sender)
> {
>   char ie_name[] = "iexplore.exe";
>   char *name_used = ie_name;
>
>   HWND h = WindowFromFile(name_used);
>
>     if (!h)
>     {
>        MessageBox(HWND_DESKTOP, name_used,
>        "Could not find IE Program", MB_OK);
>     }
>     else
>     {
>          //Hide the Window.
>          ShowWindowAsync(h,SW_HIDE);
>
>          Sleep(10000);
>
>          ShowWindowAsync(h,SW_SHOWNORMAL);
>          BringWindowToTop(h);
>          SetForegroundWindow(h);
>        }
>     }
> }
Technical Details
Message-ID: <3f9b1ea0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f930de8@newsgroups.borland.com> <3f930eb2$1@newsgroups.borland.com> <3f931b5b@newsgroups.borland.com> <3f99caaa@newsgroups.borland.com> <3f99d356$1@newsgroups.borland.com> <3f99e98a@newsgroups.borland.com> <3f9af35c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,dcd8305ed53c9568
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-25 18:39:09 PST
From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f930de8@newsgroups.borland.com> <3f930eb2$1@newsgroups.borland.com> <3f931b5b@newsgroups.borland.com> <3f99caaa@newsgroups.borland.com> <3f99d356$1@newsgroups.borland.com> <3f99e98a@newsgroups.borland.com> <3f9af35c@newsgroups.borland.com>
Subject: Re: (ATTN: Remy) Find window handle from exe file name
Date: Sat, 25 Oct 2003 21:08:48 -0400
Lines: 49
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.1106
NNTP-Posting-Host: 24.74.175.102
Message-ID: <3f9b1ea0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1067130528 24.74.175.102 (25 Oct 2003 18:08:48 -0700)
X-Authenticated-User: edmulroy
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail