473,587 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GetWindowEx() looping question

this is a little off topic but its also in comp.windows.pr ograming
and hasent goten a reply and so im posting it here:

is it possible to loop through all top level windows using
GetWindowEx(), and save all their handles in an array? i have been
trying this one for a while but it dosent seem to work i end up in a
never ending loop. anyone know how this works?

please and thank you DarkChild

Feb 22 '06 #1
13 3780
da*********@gma il.com writes:
this is a little off topic but its also in comp.windows.pr ograming
and hasent goten a reply and so im posting it here:
Actually, it's _completely_ off-topic.
is it possible to loop through all top level windows using
GetWindowEx(), and save all their handles in an array? i have been
trying this one for a while but it dosent seem to work i end up in a
never ending loop. anyone know how this works?


I'm sorry that you have been unable to get satisfactory response from
comp.windows.pr ogramming; you might try waiting a little longer, or
perhaps a web-based forum.

As to this newsgroup, I'm afraid we don't answer questions related to
non-Standard C function usage. Facilities provided by external
libraries or as extensions, etc., are way off-topic here, and as this
group already has a difficulty in keeping the signal-to-noise ratio
relatively sane, most of us simply refuse to answer such questions
(on-list, at least), even if we happen to know it (I don't).

At any rate, you are /far/ more likely to get useful responses from
trying several other Windows-programming-related forums.

Best of luck.

-Micah
Feb 23 '06 #2
da*********@gma il.com writes:
this is a little off topic but its also in comp.windows.pr ograming
and hasent goten a reply and so im posting it here:

is it possible to loop through all top level windows using
GetWindowEx(), and save all their handles in an array? i have been
trying this one for a while but it dosent seem to work i end up in a
never ending loop. anyone know how this works?


Sorry, but this is entirely off-topic here. I'm sorry you're not
getting answers in comp.windows.pr ogramming, but that doesn't make it
topical here. Perhaps you could try one of the microsoft.*
newsgroups.

When you find an appropriate newsgroup, I strongly suggest you post
the actual code you're using.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 23 '06 #3

<da*********@gm ail.com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.com...
this is a little off topic but its also in comp.windows.pr ograming
and hasent goten a reply and so im posting it here:

is it possible to loop through all top level windows using
GetWindowEx(), and save all their handles in an array? i have been
trying this one for a while but it dosent seem to work i end up in a
never ending loop. anyone know how this works?


Forgive them, for they know not what they say.

Saving the return values from a function to an array is standard C. Anyone
here can help with that. However, you unfortunately mentioned
'GetWindowsEx() ' which provokes hostility among the immature and
inconsiderate. How about rephrasing your question, and posting code where
the 'GetWindowsEx() ' is replaced by something non-descript?
Rod Pemberton
Feb 23 '06 #4
"Rod Pemberton" <do*********@so rry.bitbucket.c mm> writes:
<da*********@gm ail.com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.com...
this is a little off topic but its also in comp.windows.pr ograming
and hasent goten a reply and so im posting it here:

is it possible to loop through all top level windows using
GetWindowEx(), and save all their handles in an array? i have been
trying this one for a while but it dosent seem to work i end up in a
never ending loop. anyone know how this works?


Forgive them, for they know not what they say.

Saving the return values from a function to an array is standard C. Anyone
here can help with that. However, you unfortunately mentioned
'GetWindowsEx() ' which provokes hostility among the immature and
inconsiderate. How about rephrasing your question, and posting code where
the 'GetWindowsEx() ' is replaced by something non-descript?


Actually, Rod, my lack of ability/inclination to post a helpful
response has nothing to do with arrays.

I have no idea what GetWindowEx() does, whether it can be used to loop
through all top level windows, and whether it provides access to
handles that could be stored in an array. Even if I did know these
things, their knowledge shouldn't really affect my answer.

Now, if his post explained something more about what GetWindowEx()
does, and asked a question that is obviously a Standard C-related
question, I (and others) might be able to help.

Also, I take issue to your assertion that anyone reacted with
hostility (at least, in any messages that have yet to show up on my
server), and would challenge you to produce an example of such. I was
very careful to word my response in a non-hostile manner.

The simple fact is, his question, at least as it was framed, was about
GetWindowEx(), not arrays, and is therefore off-topic here.

-Micah
Feb 23 '06 #5
Rod Pemberton wrote:

<da*********@gm ail.com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.com...
this is a little off topic but its also in comp.windows.pr ograming
and hasent goten a reply and so im posting it here:

is it possible to loop through all top level windows using
GetWindowEx(), and save all their handles in an array? i have been
trying this one for a while but it dosent seem to work i end up in a
never ending loop. anyone know how this works?
Forgive them, for they know not what they say.

Saving the return values from a function to an array is standard C.


True.
Anyone here can help with that.
If he had posted some code, perhaps.
However, you unfortunately mentioned
'GetWindowsEx() ' which provokes hostility among the immature and
inconsiderate. How about rephrasing your question, and posting code where
the 'GetWindowsEx() ' is replaced by something non-descript?


Except you fail to realize that, lacking any sample code, it is entirely
possible that the fault lays in the way in which he uses GetWindowEx(),
and that is not something topical to clc.

Replacing "GetWindowE x()" with "something non-descript" such as "foo()"
will simply (and rightfully) be met with "what does foo() do", unless
you explain what it does.

I don't think people would have a problem with using GetWindowEx(), if
the OP were to post code, along with a description of the function.

Of course, given that Microsoft's documentation shows no such function as
"GetWindowE x()" or "GetWindowsEx() ", it's entirely possible that we're not
even talking about MS-Windows here. Or it may be some third-party library
for MS-Windows. Or it may be a typo in the OP's post. Or...

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer .h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:Th***** ********@gmail. com>

Feb 23 '06 #6
> Of course, given that Microsoft's documentation shows no such function as
"GetWindowE x()" or "GetWindowsEx() ", it's entirely possible that we're not
even talking about MS-Windows here. Or it may be some third-party library
for MS-Windows. Or it may be a typo in the OP's post. Or...


im sorry therir was an error in my pose the function is as follows:

HWND FindWindowEx(

HWND hwndParent,
HWND hwndChildAfter,
LPCTSTR lpszClass,
LPCTSTR lpszWindow
);

Parameters

hwndParent
[in] Handle to the parent window whose child windows are to be
searched.

If hwndParent is NULL, the function uses the desktop window as
the parent window. The function searches among windows that are child
windows of the desktop.

Microsoft Windows 2000 and Windows XP: If hwndParent is
HWND_MESSAGE, the function searches all message-only windows.
hwndChildAfter
[in] Handle to a child window. The search begins with the next
child window in the Z order. The child window must be a direct child
window of hwndParent, not just a descendant window.

If hwndChildAfter is NULL, the search begins with the first
child window of hwndParent.

Note that if both hwndParent and hwndChildAfter are NULL, the
function searches all top-level and message-only windows.
lpszClass
[in]

Pointer to a null-terminated string that specifies the class
name or a class atom created by a previous call to the RegisterClass or
RegisterClassEx function. The atom must be placed in the low-order word
of lpszClass; the high-order word must be zero.

If lpszClass is a string, it specifies the window class name.
The class name can be any name registered with RegisterClass or
RegisterClassEx , or any of the predefined control-class names, or it
can be MAKEINTATOM(0x8 00). In this latter case, 0x8000 is the atom for
a menu class. For more information, see the Remarks section of this
topic.
lpszWindow
[in] Pointer to a null-terminated string that specifies the
window name (the window's title). If this parameter is NULL, all window
names match.

Return Value

If the function succeeds, the return value is a handle to the
window that has the specified class and window names.

If the function fails, the return value is NULL. To get extended
error information, call GetLastError.

and sorry its off topic but im getting mixed messages so i figgure i
should try anyway.

Feb 23 '06 #7
da*********@gma il.com writes:
Of course, given that Microsoft's documentation shows no such function as
"GetWindowE x()" or "GetWindowsEx() ", it's entirely possible that we're not
even talking about MS-Windows here. Or it may be some third-party library
for MS-Windows. Or it may be a typo in the OP's post. Or...
im sorry therir was an error in my pose the function is as follows:

HWND FindWindowEx(

HWND hwndParent,
HWND hwndChildAfter,
LPCTSTR lpszClass,
LPCTSTR lpszWindow
);

[snip] and sorry its off topic but im getting mixed messages so i figgure i
should try anyway.


Sorry about the mixed messages. Some people here don't seem to
understand what's topical in this newsgroup and what isn't.

Your question is off-topic in comp.lang.c. HWND and LPCTSTR appear to
be system-specific types; we don't know how they're defined. (That's
not a request for you to explain them.)

There are a number of newsgroups that deal with MS Windows
programming. I don't know which one would be the most appropriate. I
think you mentioned comp.windows.ms .programmer; you might try
comp.os.ms-windows.program mer.win32, or perhaps one of the
microsoft.publi c.* newsgroups (there are 2349 of them on the news
server I use).

You've shown us the documentation for the FindWindowEx() function, but
you haven't shown us your code that's causing the problem. Once you
decide on an appropriate newsgroup, post a small complete compilable
program that exhibits the problem, so others can try it themselves,
and explain *exactly* how it fails (what it does and what you wanted
it to do). You shouldn't need to post a description of FindWindowEx()
if you find a forum where they already know about it.

Good luck.

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Feb 23 '06 #8
da*********@gma il.com writes:
Of course, given that Microsoft's documentation shows no such function as
"GetWindowE x()" or "GetWindowsEx() ", it's entirely possible that we're not
even talking about MS-Windows here. Or it may be some third-party library
for MS-Windows. Or it may be a typo in the OP's post. Or...


im sorry therir was an error in my pose the function is as follows:


<snip>

Thanks for posting information on the function. There's still a lot of
Windows specific stuff in the description, but I think most would be
able to get the drift.

The thing is, from reading your description of the function, there
doesn't seem to be any obvious way (to me, at least) to use it to
iterate over all windows in a class of windows, and store their
handles in an array. That doesn't mean it can't be done, but it very
much seems like the answer will be Windows-related, rather than
C-related. Again, I'd really recommend that you ask this in a
different Windows-related forum. If the first one you tried turned out
unhelpful, you should look for others: there are many.

-Micah

Feb 23 '06 #9

<da*********@gm ail.com> wrote in message
news:11******** *************@g 47g2000cwa.goog legroups.com...
this is a little off topic but its also in comp.windows.pr ograming
and hasent goten a reply and so im posting it here:

is it possible to loop through all top level windows using
GetWindowEx(), and save all their handles in an array? i have been
trying this one for a while but it dosent seem to work i end up in a
never ending loop. anyone know how this works?

please and thank you DarkChild


Post your question (including your code) to group
comp.os.ms-windows.program mer.win32. It is a very
active group with many Windows experts. They'll
likely tell you about a function called 'EnumWindows()' .

Only standard C is topical for comp.lang.c

-Mike
Feb 23 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1857
by: Colin Steadman | last post by:
I've create a simple survey using ASP. Its finished and works, but one aspect of my coding is annoying me and I cant figure out a better way of doing it. Basically the questions are stored in an Access 2000 table like this: QUESTION_NUMBER QUESTION 1 Question 1 text.... 2 Question 2 text....
3
4735
by: bellefy | last post by:
Hi All, I have a fairly large table with approx 30K rows that updates every night via a cron script that automatically downloads the 2 new csv's. The problem is the files are downloaded from two completely different systems and I've recently found duplicates! To make matters worse, the two feeds do not share a common unique key.
0
1532
by: | last post by:
Greets All, Question on data in datagrid /listbox and looping? I’m trying to decide the best way to write this code. 1 would like the user to make several selections from one listbox/combo box that would Populate another Listbox/datagrid. Then it would cycle through the selections made in the populated listbox/datagrid and do some...
0
1399
by: | last post by:
Greets All, Question on data in datagrid /listbox and looping? I’m trying to decide the best way to write this code. 1 would like the user to make several selections from one listbox/combo box that would Populate another Listbox/datagrid. Then it would cycle through the selections made in the populated listbox/datagrid and do some...
10
2108
by: Avi | last post by:
Hi I need to read in a large set of text files (9GB+ each) into a database table based on fixed width lengths. There are several ways to complete this, but I am wondering if anyone has insight into the FASTEST way to read in the data and chop it up ahead of posting it into the DB. So far, things work, but they are far slower than...
7
2147
by: jwatson | last post by:
hey guys need help or some guidances please. Basically its a complicated looping and relational question. Write a program to calculate te percentage score of the mark of the students.The program will read in any number of marks in integer, and print out the percentage score of the five categories. You should reject all the invalid marks from...
20
2816
by: Ifoel | last post by:
Hi all, Sorry im beginer in vb. I want making programm looping character or number. Just say i have numbers from 100 to 10000. just sample: Private Sub Timer1_Timer() if check1.value= 1 then
9
1544
by: Neil Gould | last post by:
I'm preparing an ASP script to send email to club members via the club's website. In getting familiar with CDOSYS, I noticed that the recommended method of sending the same content to multiple recipients is to loop through the list of recipients. I had intended to BCC the message. Is there some reason to prefer looping through recipients? ...
1
1992
by: Robocop | last post by:
Having just started using C again after some years off, i've been stumped by a problem i think someone more experienced could probably solve pretty easily. I have these 4 objects (vectors), and i want to find a combination of these 4 objects into two pairs, where the sum of a specific attribute of each vector in each pair comes closest to...
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7967
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.