🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Finding a window with exact name

#5732
From: Remy Lebeau (TeamB)
Date: Wed, 06 Jul 2005 21:28
21 lines
1749 bytes
"Jeff" <Jeff@nospam.com> wrote in message
news:42cc47bf$1@newsgroups.borland.com...

> Does anyone know of a method for finding a window without
> knowing its exact caption? I've used FindWindow() before, but
> I'm trying to find a window that has a changing title.

Then you cannot use FindWindow(), unless the window has a unique class name,
in which case FindWindow() can search for that instead of the caption text.

Otherwise, you will have to enuerate the windows manually, looking at the
caption of each one and doing your own comparison yourself.  Use
FindWindow(NULL, NULL) to get the first window on the desktop, then
GetNextWindow(GW_HWNDNEXT) in a loop to get each window after that.  Or use
EnumWindows().  Either way, you can then use the WM_GETTEXT message to
retreive the caption of each window, then search the text for whatever you
are looking for.


Gambit
Technical Details
Message-ID: <42cc4f0c$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42cc47bf$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,cad48e5a1c8d424f
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42cc47bf$1@newsgroups.borland.com>
Subject: Re: Finding a window with exact name
Date: Wed, 6 Jul 2005 14:28:04 -0700
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <42cc4f0c$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1120685836 68.69.17.41 (6 Jul 2005 14:37:16 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail