473,771 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

waitforinputidl e() & MainWindowHandl e

Hi all,
I am trying to launch an process in .net as follows.I want to wait
till mainwindow handle is initialized. fowlloing code works some times
i.e i can read the value of mainwindow handle but some times it
returns 0. I see the IE launched but still mainwindow handle is 0.

I have pasted the code below.
Question on waitforinputidl e()

A.Help on this method says "if process does not have a message queue,
WaitForInputIdl e returns immediately"

so if i lauch internet explorer but there are no messages waiting to
be processed by this instance of IE is it possible for
waitforinputidl e() to return uninitialized value of mian windows
which is 0?

B. my orginal code was like this..
m_IeProcess = Process.Start(" IExplore.exe");
if i change this to
m_IeProcess = Process.Start(" IExplore.exe"," www.yahoo.com") ;
does it ensures that now if i do wait WaitForInputIdl e(); and
refresh()..then check the hadle it will have value.
since we are redirecting to a URL immediatley would it ensure that
there is something(messa ge) waiting to be proceesed and thus for IE to
navigate to this URL it has to first initialize ..including setting up
handle.

question is ...if this 'redirect to URL' same as message that
waitforinputidl e() will wait for?
or message here means like user tryping key stocks which will go to
windows message que
ue?

c. if B above is not the solution ..what else can i try.except for
looping and retry. looping and retry are not really clean reliable
solutions

=============== =============== ===============

m_IeProcess = Process.Start(" IExplore.exe");
m_IeProcess.Wai tForInputIdle() ;
m_IeProcess.Ref resh();

//check if still 0
if (m_IeProcess.Ma inWindowHandle == Intptr.Zero )
{
//still zero
}

thanks
Sidd

Sep 14 '07 #1
0 2196

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

Similar topics

1
11443
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a href="mailto:DrTebi@yahoo.com">DrTebi</a> This would work like a regular mailto link in any browser, but wouldn't be visible to spiders if they don't have a function to decode it.
0
2423
by: Thomas Scheffler | last post by:
Hi, I runned in trouble using XALAN for XSL-Transformation. The following snipplet show what I mean: <a href="http://blah.com/?test=test&amp;test2=test2">Test1&amp;</a> <a href="http://blah.com/?test=test&amp;amp;test2=test2">Test2&amp;amp;</a> This results in the following HTML Code:
4
3229
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know that I could externalize my JavaScript, but that will not be practical throughout this application. Is there any way to get around this issue? Xalan processor. Stripped down stylesheet below along with XHTML output. <?xml version='1.0'?>...
2
4483
by: Moty Michaely | last post by:
Hello all, I am enumerating vb6 process from c# application by name. I need to send message to all processes that has the specified name but for this purpose I need the handle of the main window for each process returned. I once read that vb6 app mainWindowHandle is the handle of the hidden window that runs the application.
0
2623
by: Michiel | last post by:
Hello, When I execute the following code Process* oProc; IntPtr ipMain; HWND hWnd; oProc=Process::GetProcessById(m_IProcId); ipMain=oProc->MainWindowHandle; hWnd=(HWND)ipMain.ToPointer();
1
1414
by: smith | last post by:
I was recently set to release an app that used very common single instance code and hit the oddest issue. After many hours of full build tests I believe that it is duplicatable. Environment: ..Net 1.1 (v1.1.4322) Windows 2000Pro HyperThreading machine
14
5935
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
1
2529
by: codejunkie | last post by:
Hi, I am running a suite of tests of a WIN 32 application. Every test launches the same application, checks if the Application has a Main Window handle and then proceeds. However i am noticing when i run a reasonably large ( 80-90) number of tests one after the other the Main Window handle API displays inconsistant behavior. About 70% of the time my application returns a valid Main WIndow handle
12
10117
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
0
9619
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.