Article View: borland.public.cppbuilder.nativeapi
Article #1803Re: EnumWindows etc.
From: Ed Mulroy
Date: Sun, 10 Jun 2007 01:51
Date: Sun, 10 Jun 2007 01:51
85 lines
4532 bytes
4532 bytes
> I would perfer to have a linked list (or the kind) of HWND.
> Can you please show me how to declare that struct?
Ok, a structure to use in a doubly linked list:
struct WindowData
{
HWND hwnd;
AnsiString caption;
WindowData *prev_item;
WindowData *next_item;
};
However that means you must allocate each node (each instance of the
structure), keep copies of the addresses of the first and current items and
adjust the links yourself. However doing a linked list yourself is a lot of
coding and I don't see how this task needs an actual linked list rather than
a simple array.
You might consider using what the language provides. You could use a vector
(a standard C++ item) it does the allocation for you and handles things as
an array. C++ provides functions that you can use to sort the vector and
search for an instance containing a matching item.
> ...I have Win32 Programming reference by:
> Rector / Newcomer (Addison Wesley publication)... But the
> references are cryptic and contain little examples...
The compiler came with a Win32 help file that you can use. Since Windows is
from Microsoft they provide MSDN, Microsoft Developer Network, and it has
examples, although some suffer from undue complication such as the obviously
1991 vintage example for EnumProc that you were using.
http://msdn2.microsoft.com/en-us/Library
I have some programming pages posted with links to tutorials and other
information. Look at them and see if they help:
http://www.mulroy.org/programg.htm
> Once I have the state of the window, what API call do I use
> to maximize or minimize it?
Look at the function ShowWindow
http://msdn2.microsoft.com/en-us/library/ms633548.aspx
. Ed
> Matthew wrote in message
> news:466b54ac$1@newsgroups.borland.com...
>
>>I do not know why you need the process id or class name for the window.
>
> As far as I know - I don't need the ID or class name. The code
> I am using is example code from C++ BCB 6 - and I'm wading
> through in an attempt to understand the necessary API calls
> to do what I getting at.
>
>>keep an internal list of HWND and window caption. You can save
>>those two items into a structure that you define and use one
>
> I would perfer to have a linked list (or the kind) of HWND.
> Can you please show me how to declare that struct?
>
> e.g. - does the struct need pointer types? And if so, what
> type are they?
>
>>When the user double clicks on a caption in the list box you can
>>then go through your internal list and find the associated window
>>handle, the HWND.
>
>>You can then test its state with IsIconic and IsZoomed and decide
>>what to do with it.
>
> Yeah - Bob said that IsIconic and IsZoomed are two calls I
> have to look at. I have Win32 Programming reference by:
> Rector / Newcomer (Addison Wesley publication)... But the
> references are cryptic and contain little examples.
>
> I'm assuming that if I have a list of HWND - that one of the
> structs components will have a pointer reference to the
> window I wish to affect with IsIconic, and IsZoomed.
>
> Once I have the state of the window, what API call do I use
> to maximize or minimize it?
>
> Again - thanks for keeping this thread alive with answers.
Technical Details
Message-ID:
<466b5915$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4668d902$1@newsgroups.borland.com> <l2ri63pmm23tsci1u4subhitr6cchmm147@4ax.com> <4669fbaf$1@newsgroups.borland.com> <466aacf2$1@newsgroups.borland.com> <466aefff$1@newsgroups.borland.com> <466b4b25$1@newsgroups.borland.com> <466b54ac$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,859e738ad5fa0eae X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Ed Mulroy" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <4668d902$1@newsgroups.borland.com> <l2ri63pmm23tsci1u4subhitr6cchmm147@4ax.com> <4669fbaf$1@newsgroups.borland.com> <466aacf2$1@newsgroups.borland.com> <466aefff$1@newsgroups.borland.com> <466b4b25$1@newsgroups.borland.com> <466b54ac$1@newsgroups.borland.com> Subject: Re: EnumWindows etc. Date: Sat, 9 Jun 2007 21:51:21 -0400 Lines: 87 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 69.141.82.147 Message-ID: <466b5915$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1181440277 69.141.82.147 (9 Jun 2007 18:51:17 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail