473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

List of all Child Windows ?

Mel
is it possible to get a list of all child windows (poped from a parent
window) ?
and close all of them ?

thanks for help
Jul 23 '05 #1
2 12030
In article <42******@usenet01.boi.hp.com>, me**********@hp.com enlightened us
with...
is it possible to get a list of all child windows (poped from a parent
window) ?
and close all of them ?


I believe this is only possible if you save handles to them as you open them.

--
--
~kaeli~
Contrary to popular opinion, the plural of 'anecdote' is
not 'fact'.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
Mel wrote:
is it possible to get a list of all child windows (poped from a parent window) ?
and close all of them ?

thanks for help


Something like this...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>untitled</title>
<style type="text/css">

input {
width: 80px;
font-size: 75%;
background: beige;
padding: 2px;
margin: 2px;
}

</style>
<script type="text/javascript">

function popit(n)
{
var w, wname = 'pop' + n;
var l = 100 * n + 100;
var t = 100 * n + 100;
w = window.open('javascript:"<h4>'+wname+'</h4>"',
wname,
'width=200,height=200,left='+l+',top='+t+',status= 0');
addName(wname);
return false;
}

function addName(wname)
{
self.name += (wname + '@');
}

function closeByName(wname)
{
window.open('javascript:"<script>window.close()<\/script>"', wname);
}

function closeAll()
{
var wname,
wcoll = self.name.split('@');
self.name = '';
for (var i = 0, l = wcoll.length; i < l; ++i)
if (wname = wcoll[i])
closeByName(wname);
return false;
}

</script>
</head>
<body>
<form>
<input id="w1" type="button"
value="open pop 1"
onclick="popit(1)" />
<br />
<input id="w2" type="button"
value="open pop 2"
onclick="popit(2)" />
<br />
<input id="w3" type="button"
value="open pop 3"
onclick="popit(3)" />
<br /><br />
<input id="ca" type="button"
value="close all"
onclick="closeAll()" />
</form>
</body>
</html>

Saves the popup name in - where else? - the name string of the opener
window. You can then get the (popup window) object back by calling
..open() again & using that name. The browser won't allow two windows
with the same name, so .open() simply loads a closer script in the
original. Storing it in the opener's name guarantees persistence across
pages (yours, anyway). No guarantees with this one...

Jul 23 '05 #3

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

Similar topics

8
by: dp | last post by:
Is there anyway to have the bullet color of a <li> be a different color than the text without using an image? dp
7
by: Kieran Simkin | last post by:
Hi all, I'm having some trouble with a linked list function and was wondering if anyone could shed any light on it. Basically I have a singly-linked list which stores pid numbers of a process's...
8
by: CJack | last post by:
hy, I have an mdi application, i create a child form and I want to know when a button is pressed while that child form is loaded. I have this code: private void frmTestBaby_KeyUp(object sender,...
3
by: Maheshkumar.R | last post by:
Hi groups, How i can command over the MDI CHIlD forms created dynamically at runtime from PARENT. Let say, i have generated 5 mdichild forms, but i want to work with child form1 from MDI...
1
by: Mac via DotNetMonster.com | last post by:
Hi all, I have an MDI application with a function that displays a popup window (through the showdialog method) which displays all the current MDI child windows. I know how to get a list of...
8
by: Vivek | last post by:
Hi, I wish to update the LIST<T> created in PARENT FORM from the CHILD FORM. Currently I have declared the LIST<Role> as public in my parent form. What can I do to update the <LIST>? Thanks
5
by: cmk128 | last post by:
Hi In the following code, when you create a object of class child, parent class (class mother) will hold a reference. But i want every class derived from mother class has this ability without...
4
by: normb | last post by:
My name is Norm, I changed something that caused this problem, and I do not what it was. I also do not know how to debug this problem! The line where the crash occures is marked by an *. The...
5
by: shapper | last post by:
Hello, I have the following list: <ul id="parent" class="parent"> <li> <img... </li> <ul id="child" class="child"> <li>Message 1</li>
1
by: jmartmem | last post by:
Greetings, I have a nagging problem with client-side dynamic dependent list boxes that perhaps someone can help me troubleshoot. I have a form with a series of dynamic dependent list boxes....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.