Re: Programmatic clicking and new windows

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Jan 11, 9:20 pm, mr_unreliable <kindlyReplyToNewsgr...@xxxxxxxxxxx>
wrote:
Csaba Gabor wrote:
Subject to the popup blocker, the code below will bring up
two instances of IE. The first one is identified by the
variable ie below. What is the cleanest way to get
ahold of the second one that gets created in the
last line (lnk.click)?

hi Csaba,

You might be able to use the "shell.application" to do
what you want. You can search through the window objects
and find the instances of IE, and then use the document
title to find the specific instance you want.

Here is a script that illustrates this (not exactly, but
close enough).
....
Example script
....
As you see, look through the windows for type "htmldocument".
Then look for the title. You also have access to the doc
object model for each IE window.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)

Hi jw,
Thanks for your thoughts, here's a follow up. I am
aware of your approach of iterating through
Set Wins = CreateObject("Shell.Application").Windows
In fact, Eduardo's code would be simplified, methinks,
(and doable in VBScript) if he just compared the hwnd
property of each window within Wins.
The trouble is that neither approach is iron clad.

I found an ancient thread which gave the recommended way at
http://groups.google.com/group/microsoft.public.vb.general.discussion/browse_frm/thread/ada57def698a129/
in RND's last post: he used IE's NewWindow2 event (there
is also NewWindow3). Now this is sort of a funny sort of
creature - the event handler wants its first argument set
to a newly created IE to override the default IE that would
be created. Unfortunately, VBScript can't pass the
modified ByRef argument. So you can watch it, and know
it's about to happen, but you can't do anything about it.

However, PHP is able to work with this event handler
(sort of) and it works. Unfortunately, PHP has a bug
as far as I can tell in setting the (first arg's object) value.
Somewhere in the process they corrupt the variable (the
new IE object), but by then I've got its hwnd (ha ha),
so it is no longer able to hide from me. The problem is
that after running beautifully, this little copying maneuvre
prevents PHP from quitting gracefully - I get a nasty error
each time, presumably reference counts are messed up.
So all I hope is that a developer responds to the bug
report I made.

Regards,
Csaba
.



Relevant Pages

  • Re: Programmatic clicking and new windows
    ... Now this is sort of a funny sort of ... PHP is able to work with this event handler ... So all I hope is that a developer responds to the bug ...
    (microsoft.public.scripting.vbscript)
  • Re: [9fans] missing applications
    ... The point is that the window manager will do the window management and I ... Just set sort by date instead of thread. ... not for any other system than plan9. ... content of pakets? ...
    (comp.os.plan9)
  • Re: e-commerce portal
    ... haven't had a single site that sees a need for this sort of hardening. ... Java anymore. ... PHP is a technology that has gotten a harsh rap due to large security ... Marketing at its worse, eh? ...
    (comp.databases.pick)
  • Re: populate a popup window using php and javascript
    ... javascript is infant at best and php is novice. ... when the user clicks on one of the trips a popup window opens with the ...
    (comp.lang.php)
  • Re: setting window size and php
    ... you let PHP just put in the right values for JavaScript to use. ... I want a window ... I bet your SQL is vunurable to SQL injection. ...
    (comp.lang.javascript)