473,394 Members | 1,703 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,394 software developers and data experts.

waitforinputidle() & MainWindowHandle

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 waitforinputidle()

A.Help on this method says "if process does not have a message queue,
WaitForInputIdle 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
waitforinputidle() 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 WaitForInputIdle(); 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(message) 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
waitforinputidle() 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.WaitForInputIdle();
m_IeProcess.Refresh();

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

thanks
Sidd

Sep 14 '07 #1
0 2184

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

Similar topics

1
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...
0
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...
4
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...
2
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...
0
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
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: ...
14
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...
1
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...
12
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)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.