Article View: borland.public.cppbuilder.nativeapi
Article #10867Re: Close a Program!?
From: Ed Mulroy [TeamB]
Date: Fri, 12 Mar 2004 00:24
Date: Fri, 12 Mar 2004 00:24
26 lines
1875 bytes
1875 bytes
Classes provided by Windows often are given a number instead of a
name. That is the case with the DIALOG class you mention here which
is 32770. Windows provides a macro to handle that and make the number
into a correct style of calling argument for a function which expects
a string for a class or resource name.
Try using the line altered in this way (the line wrap is just due to
the news reader).
HWND MyMean =
FindWindow(MAKEINTRESOURCE(32770), OECaptionName);
. Ed
> Safari wrote in message
> news:4051013a@newsgroups.borland.com...
>
> Example: Msimn.exe = Microsoft Outlook Express;
>
> void __fastcall TMain::BitBtn1Click(TObject *Sender)
> {
> HWND MyMean = FindWindow(OEClassName, OECaptionName);
> SendMessage(MyMean, WM_SYSCOMMAND, SC_CLOSE, 0);
> }
> I want a close a program with class name, but my class
> is #32770!
Technical Details
Message-ID:
<40510346$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-mailReferences:
<404fc418@newsgroups.borland.com> <404fe0d3$1@newsgroups.borland.com> <4051013a@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,ae22238877755cbc X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-11 16:40:29 PST From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <404fc418@newsgroups.borland.com> <404fe0d3$1@newsgroups.borland.com> <4051013a@newsgroups.borland.com> Subject: Re: Close a Program!? Date: Thu, 11 Mar 2004 19:24:11 -0500 Lines: 28 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: <40510346$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1079051078 24.74.175.102 (11 Mar 2004 16:24:38 -0800) 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