Re: Stumped: JAWS GetObject function for current browser window?

  • From: "Bryan Garaventa" <bryan@xxxxxxxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 21 Sep 2007 21:52:31 -0700

Ah well, I guess my last message was a little premature...

Though I can return the number of instances currently running, I cannot actually access the object within the collection.

; This is the code that works for returning the numbered collection:

var object objWMIService,

object colProcesses,

int NumberOfProcesses



let objWMIService = GetObject("winmgmts:\\\\" +

"." +

\\root\\cimv2)



let colProcesses = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'iexplore.exe'")



let NumberOfProcesses = colProcesses.Count



SayInteger (NumberOfProcesses) ; Returns accurately the number of running IE instances



; Now for the part that doesn't work...



var string Info



While (NumberOfProcesses)



let ssBrowser = colProcesses(NumberOfProcesses - 1)



let Info = ssBrowser.Handle

Say (Info, 0) ; Returns ""



let Info = ssBrowser.ProcessID

Say (Info, 0) ; Returns ""



let NumberOfProcesses = NumberOfProcesses - 1

EndWhile


Any ideas?

----- Original Message ----- From: "Bryan Garaventa" <bryan@xxxxxxxxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, September 21, 2007 9:26 PM
Subject: Re: Stumped: JAWS GetObject function for current browser window?


Ouch, that was stupid, forgot about the backslashes... It works now, by changing the following block.

let objWMIService = GetObject("winmgmts:\\\\" +

"." +

\\root\\cimv2)


Now I just need to figure out what kind of object I've returned, and how it applies to the currently open web page... I guess nothings ever simple.

----- Original Message ----- From: "Bryan Garaventa" <bryan@xxxxxxxxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, September 21, 2007 9:15 PM
Subject: Re: Stumped: JAWS GetObject function for current browser window?


ok, I've disassembled the VB Script code, and made the following JAWS script. By all rights, it should work. It doesn't though... Returns zero every time. Do you see what I'm doing wrong?

var object objWMIService,

object colProcesses,

int NumberOfProcesses



let objWMIService = GetObject("winmgmts:\\" +

"." +

"\root\cimv2")



let colProcesses = objWMIService.ExecQuery("Select * from Win32_Process Where Name = 'iexplore.exe'")



let NumberOfProcesses = colProcesses.Count



SayInteger (NumberOfProcesses)


Does it matter that I'm running IE7?

Thanks,

Bryan
----- Original Message ----- From: "Martin Slack" <m.g.slack@xxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, September 21, 2007 12:46 PM
Subject: Re: Stumped: JAWS GetObject function for current browser window?


Hi Bryan,

I'm not sure this is exactly what you're looking for, but it's the guts of a vbs file that I found recently while Googling for something else.

It uses WMI to find all instances of Internet Explorer currently running on your own machine.

If you twist Jamal's arm, you may be able to get him to integrate this seamlessly into JAWS Script code.

 Here it is anyway:

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set objShell = CreateObject("Wscript.Shell")

Set colProcesses = objWMIService.ExecQuery _
   ("Select * from Win32_Process Where Name = 'iexplore.exe'")
 WScript.Echo "Number alive: " & colProcesses.Count

For Each proc in colProcesses
 WScript.Echo "Handle: " & proc.Handle
 WScript.Echo "Process ID: " & proc.ProcessID
Next

 I don't think any lines have wrapped, but caveat emptor...

 Martin


----- Original Message ----- From: "Bryan Garaventa" <bryan@xxxxxxxxxxxxxxxxxxx>
To: <ProgrammingBlind@xxxxxxxxxxxxx>
Sent: Friday, September 21, 2007 7:03 PM
Subject: Stumped: JAWS GetObject function for current browser window?


Are there any JAWS scripters or Windows API programmers out there that can help me figure this problem out?

I need to create an object that reflects the current browser instance within a script, but am having trouble figuring out how to do this. For instance...

var object BrowserInstance
let BrowserInstance = GetObject("NoIdeaWhatToPutHere...")

Specifically, I need to retrieve the currently running instance of Internet Explorer7, as it appears when currently running.

The object type that I need to return is the Internet Explorer IDispatch object for the running application, which I asume would be properly named within the Windows Running Object Table.

If I could get the name for the instance of IE7 as listed in the Windows Running Object Table, presumably I could use the GetObject function successfully to retrieve this object.

Do you have any ideas how I might be able to do this? Any help would be greatly appreciated.

Thanks, and best wishes,

Bryan Garaventa




__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind



__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind



__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind



__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: