473,396 Members | 2,020 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.

Shell.Application.Windows() -- What if a window is hanging?

Hi there

My VB Code looks something like that:

************************************************** ************
Dim oShellApplication = CreateObject("Shell.Application")
Dim objWindow
For Each objWindow In oShellApplication.Windows()
'do stupid things with IE
Next objWindow
************************************************** ************

The most of time, this works fine, but if some of the Window is hanging
(gives no response), the script goes hold on, until all window gives a
response. What can i do, to jump over a hanging window?

thanx a lot!

greets adi
Jun 4 '07 #1
6 8507
Adrian,

I would not know and probably most of us don't we use the Process command
for this.

///Internet Explorere
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.FileName = "http://msdn.microsoft.com"
p.StartInfo = pi
p.Start()

I hope this helps,

Cor

"Adrian" <ry***@netdot.chschreef in bericht
news:46********@news.bluewin.ch...
Hi there

My VB Code looks something like that:

************************************************** ************
Dim oShellApplication = CreateObject("Shell.Application")
Dim objWindow
For Each objWindow In oShellApplication.Windows()
'do stupid things with IE
Next objWindow
************************************************** ************

The most of time, this works fine, but if some of the Window is hanging
(gives no response), the script goes hold on, until all window gives a
response. What can i do, to jump over a hanging window?

thanx a lot!

greets adi

Jun 5 '07 #2
Hi Cor

You describe what is todo, to start a new Process. But i would like to
go through all open process (internet explorer windows) and find a
specific one. You know what i mean?

Thank u!
Adrian,

I would not know and probably most of us don't we use the Process command
for this.

///Internet Explorere
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.FileName = "http://msdn.microsoft.com"
p.StartInfo = pi
p.Start()

I hope this helps,

Cor

"Adrian" <ry***@netdot.chschreef in bericht
news:46********@news.bluewin.ch...
>Hi there

My VB Code looks something like that:

************************************************* *************
Dim oShellApplication = CreateObject("Shell.Application")
Dim objWindow
For Each objWindow In oShellApplication.Windows()
'do stupid things with IE
Next objWindow
************************************************* *************

The most of time, this works fine, but if some of the Window is hanging
(gives no response), the script goes hold on, until all window gives a
response. What can i do, to jump over a hanging window?

thanx a lot!

greets adi

Jun 5 '07 #3
Adrian,

You need than interoperatiblility with shdocvw. Hard stuff to work with.
http://support.microsoft.com/kb/176792

I hope this helps a little bit

Cor

"Adrian" <ry***@netdot.chschreef in bericht
news:46**********@news.bluewin.ch...
Hi Cor

You describe what is todo, to start a new Process. But i would like to go
through all open process (internet explorer windows) and find a specific
one. You know what i mean?

Thank u!
>Adrian,

I would not know and probably most of us don't we use the Process command
for this.

///Internet Explorere
Dim p As New Process
Dim pi As New ProcessStartInfo
pi.FileName = "http://msdn.microsoft.com"
p.StartInfo = pi
p.Start()

I hope this helps,

Cor

"Adrian" <ry***@netdot.chschreef in bericht
news:46********@news.bluewin.ch...
>>Hi there

My VB Code looks something like that:

************************************************ **************
Dim oShellApplication = CreateObject("Shell.Application")
Dim objWindow
For Each objWindow In oShellApplication.Windows()
'do stupid things with IE
Next objWindow
************************************************ **************

The most of time, this works fine, but if some of the Window is hanging
(gives no response), the script goes hold on, until all window gives a
response. What can i do, to jump over a hanging window?

thanx a lot!

greets adi
Jun 6 '07 #4
On Jun 4, 3:54 pm, Adrian <r...@netdot.chwrote:
Hi there

My VB Code looks something like that:

************************************************** ************
Dim oShellApplication = CreateObject("Shell.Application")
Dim objWindow
For Each objWindow In oShellApplication.Windows()
'do stupid things with IE
Next objWindow
************************************************** ************

The most of time, this works fine, but if some of the Window is hanging
(gives no response), the script goes hold on, until all window gives a
response. What can i do, to jump over a hanging window?

thanx a lot!

greets adi
I believe you could use the SendMessageTimeout API call to see if a
window is hung (it has a flag that aborts the call if the window is
hung as well as a timeout), so perhaps you could it to check if a
window is hung before trying to "do stupid things"

Here's the pinvoke.net pages:

http://www.pinvoke.net/default.aspx/...geTimeout.html
http://www.pinvoke.net/default.aspx/...eoutFlags.html

Thanks,

Seth Rowe

Jun 6 '07 #5
Hi Seth

That's exactly what i searched for... thanx a lot!

greets

rowe_newsgroups schrieb:
On Jun 4, 3:54 pm, Adrian <r...@netdot.chwrote:
>Hi there

My VB Code looks something like that:

************************************************* *************
Dim oShellApplication = CreateObject("Shell.Application")
Dim objWindow
For Each objWindow In oShellApplication.Windows()
'do stupid things with IE
Next objWindow
************************************************* *************

The most of time, this works fine, but if some of the Window is hanging
(gives no response), the script goes hold on, until all window gives a
response. What can i do, to jump over a hanging window?

thanx a lot!

greets adi

I believe you could use the SendMessageTimeout API call to see if a
window is hung (it has a flag that aborts the call if the window is
hung as well as a timeout), so perhaps you could it to check if a
window is hung before trying to "do stupid things"

Here's the pinvoke.net pages:

http://www.pinvoke.net/default.aspx/...geTimeout.html
http://www.pinvoke.net/default.aspx/...eoutFlags.html

Thanks,

Seth Rowe
Jun 13 '07 #6
One last question...
Could u write some sample code for me please?
I've no idea how to use this api...

sorry & thanx

rowe_newsgroups schrieb:
On Jun 4, 3:54 pm, Adrian <r...@netdot.chwrote:
>Hi there

My VB Code looks something like that:

************************************************* *************
Dim oShellApplication = CreateObject("Shell.Application")
Dim objWindow
For Each objWindow In oShellApplication.Windows()
'do stupid things with IE
Next objWindow
************************************************* *************

The most of time, this works fine, but if some of the Window is hanging
(gives no response), the script goes hold on, until all window gives a
response. What can i do, to jump over a hanging window?

thanx a lot!

greets adi

I believe you could use the SendMessageTimeout API call to see if a
window is hung (it has a flag that aborts the call if the window is
hung as well as a timeout), so perhaps you could it to check if a
window is hung before trying to "do stupid things"

Here's the pinvoke.net pages:

http://www.pinvoke.net/default.aspx/...geTimeout.html
http://www.pinvoke.net/default.aspx/...eoutFlags.html

Thanks,

Seth Rowe
Jun 13 '07 #7

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

Similar topics

9
by: none | last post by:
Hello all, I wrote a shell program a few years ago in VB6 that needs to be modified. The problem I have is this: The SysAdmin uses this shell in place of Explorer, so there is no taskbar. When...
12
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am...
3
by: Pete | last post by:
Is there any possiblity of writing an Access or Visual Basic application that provides a method of sharing the window focus between Access and the Shell application? i.e....
6
by: Lauren Wilson | last post by:
Hi folks, In an A2K app, I have attempted to use the following command in some VBA code with IDENTICAL results with every single version of the following: Shell "outlook.exe", vbHide Shell...
2
by: lauren quantrell | last post by:
Using the Windows RUN/Open window I can enter the following to open the application and have it directed to my specified folder: "C:\Program Files\MyAPplication.exe" "C:\Documents and...
3
by: felecha | last post by:
I can get Windows Media Player to start, and play a wav file just fine using a command line "C:\Program Files\Windows Media Player\wmplayer.exe" c:\Temp\temp.wav But I want it to come up from...
6
by: Pieter | last post by:
Hi, I'm trying to use the Edanmo Shell Extension Library (http://www.mvps.org/emorcillo/en/code/shell/shellextensions.shtml) to make a Context Menu in the Windows Explorer with VB.NET 2005. It...
15
by: lixinyi.23 | last post by:
Hi! I'm currently working on a scientific computation software built in python. What I want to implement is a Matlab style command window <-> workspace interaction. For example, you type...
3
by: Max Vit | last post by:
I have come across a strange issue whilst trying to use a shell command call from Access and have spent some time trying to figure this out but can't find the cause as yet. The issue is: I need...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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,...

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.