mixedup
October 14th, 2005, 06:26 AM
Hi,
Is there a bug in the win.KillWindow function? or am I doing something wrong.
If I try to kill internet explorer windows using the LUA function it is not working, however if I use the Girder close window function (using same CLASS name for targetting) it works fine. Below is my LUA code extract, then below this the standard out. As the output shows I am getting the handle to the window OK, however the win.KillWindow function is not killing off the window. As I can't call out to the girder action that does work from within the LUA script I need to work this one out.
Any ideas?
function getIEhandle()
print ("DEBUG: Entering getIEhandle")
local h, err
h, err = [b]win.FindWindow[/b] ("IEFRAME",nil)
if (h == nil)
then print("ERROR: Finding IE, error = ", err, " h=", h);
return
else
print("DEBUG: Found IE window, h=", h);
return h
end
end
print ("DEBUG: Entering closeIE")
local h = getIEhandle()
while (not (h == nil)) do
print ("INFO: Killing window ", h)
win.KillWindow (h, 2000)
oldh = h
h = getIEhandle()
if (oldh == h) then
print ("ERROR: Found same handle again!")
return
end
end
Stardard output:
---------------------------------------
DEBUG: Entering closeIE
DEBUG: Entering getIEhandle
DEBUG: Found IE window, h= 1771250
INFO: Killing window 1771250
DEBUG: Entering getIEhandle
DEBUG: Found IE window, h= 1771250
ERROR: Found same handle again!
---------------------------------------
Is there a bug in the win.KillWindow function? or am I doing something wrong.
If I try to kill internet explorer windows using the LUA function it is not working, however if I use the Girder close window function (using same CLASS name for targetting) it works fine. Below is my LUA code extract, then below this the standard out. As the output shows I am getting the handle to the window OK, however the win.KillWindow function is not killing off the window. As I can't call out to the girder action that does work from within the LUA script I need to work this one out.
Any ideas?
function getIEhandle()
print ("DEBUG: Entering getIEhandle")
local h, err
h, err = [b]win.FindWindow[/b] ("IEFRAME",nil)
if (h == nil)
then print("ERROR: Finding IE, error = ", err, " h=", h);
return
else
print("DEBUG: Found IE window, h=", h);
return h
end
end
print ("DEBUG: Entering closeIE")
local h = getIEhandle()
while (not (h == nil)) do
print ("INFO: Killing window ", h)
win.KillWindow (h, 2000)
oldh = h
h = getIEhandle()
if (oldh == h) then
print ("ERROR: Found same handle again!")
return
end
end
Stardard output:
---------------------------------------
DEBUG: Entering closeIE
DEBUG: Entering getIEhandle
DEBUG: Found IE window, h= 1771250
INFO: Killing window 1771250
DEBUG: Entering getIEhandle
DEBUG: Found IE window, h= 1771250
ERROR: Found same handle again!
---------------------------------------