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

How to find a textbox?

How can I find the textbox (handle?) e.g. from
http://www.microsoft.com/
on the right top corner from my program?
And how can I identify the textbox again, if
a new browser window is opened with the
same page? Both textboxes have different handles.
How can I recognize the same textbox?

Marc
Nov 20 '05 #1
7 1709
"Marc Fauser" <ma*********************@fauser-ag.com> wrote in message
news:ej**************@TK2MSFTNGP10.phx.gbl...
How can I find the textbox (handle?) e.g. from
http://www.microsoft.com/
on the right top corner from my program?
huh?
And how can I identify the textbox again, if
a new browser window is opened with the
same page?
What are you talking about? Your program, or a web browser?
Both textboxes have different handles.
How can I recognize the same textbox?


Hard to say, could you be a little more vague?

Nov 20 '05 #2
> Hard to say, could you be a little more vague?

Sorry.

I want to access a textbox inside the Internet Explorer
from my program. Like the search textbox from Google.

Marc
Nov 20 '05 #3
Marc,

* "Marc Fauser" <ma*********************@fauser-ag.com> scripsit:
Sorry.

I want to access a textbox inside the Internet Explorer
from my program. Like the search textbox from Google.


Did you have a look at the textbox using the Spy++ tool which comes with
VS.NET Professional or better? If you can access this window using
this tool, you may be able to access it through p/invoke on
'FindWindow', 'FindWindowEx', 'GetClassName', ...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
"Marc Fauser" <ma*********************@fauser-ag.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
I want to access a textbox inside the Internet Explorer
from my program. Like the search textbox from Google.

I agree with Wagner, I would use a tool like Spy ++ to determine the Class
Name & Handle of the child you are tying to find. Next, I would call
GetWindow(GW_HWNDFIRST) to get the first child, set up an infinite loop of
GetWindow(GW_HWNDNEXT), and then add a break-point or step into the code and
manually advance through each loop. Once you arrive at the Handle of the
window you are looking for, you can set a specific number of iterations to
find the child (ie. if it takes 5 loops to find the handle that you know is
good, then hard-code 5 into your infinite loop, making it not infinite
anymore).

However, this approach is *extremely* brittle, something even so minor as
changing the order of the toolbars will break your code. I would only use
this method in a closed environment, as a tool for my own personal use.

Another approach would be to find the /class name/ of the child you are
looking for- use FindWindow to find the Browser window, then make a loop
that uses GetWindow to iterate through every child, then use GetWindowClass
to get the actuall class name of the child.

This method is almost as bad as hard coding an index (as in the first
method), because if a new toolbar is added before the one that hosts your
text box, and the new toolbar also contains a text box with the same class
name (very possible), you will mistakenly get the wrong text box.

~
Jeremy
Nov 20 '05 #5
Cor
>

I agree with Wagner,


This one Jeremy
http://users.utu.fi/~hansalmi/wagner.spml

Cor
Nov 20 '05 #6
* "Cor" <no*@non.com> scripsit:
I agree with Wagner,


This one Jeremy
http://users.utu.fi/~hansalmi/wagner.spml


LOL

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
"Cor" <no*@non.com> wrote in message
news:Oc**************@TK2MSFTNGP12.phx.gbl...


I agree with Wagner,


This one Jeremy
http://users.utu.fi/~hansalmi/wagner.spml


"The most German of men"

lmao. that's great

Nov 20 '05 #8

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

Similar topics

8
by: jquest | last post by:
Hi Again; I have had help from this group before and want to thank everyone, especially PCDatasheet. My database includes a field called HomePhone, it uses the (xxx)xxx-xxx format to include...
3
by: Poewood | last post by:
Okay here are four classes for a pocket pc program: Input, fpositional, ComboBoxArray and TextBoxArray. The "input" class is the form. I use the fpositional class to handle most of the functions...
4
by: Edward | last post by:
hi, everyone, my Page_Load fill tblProducts with some TextBox. <form runat="server"> <asp:Table id="tblProducts" runat="server"></asp:Table> <hr> <asp:Button id="Button1"...
2
by: Josh | last post by:
Hi Guys, I have been stuck on this problem for several days now, i have a set of nested datagrids. Inside the second datagrid i have a dropdown list, a textbox and a label. I want the textbox...
2
by: Chris Fink | last post by:
This should be relatively simple but I am unable to find an asp:button tag in a datalist footer. I have tried it numerous ways including the FindControl method from the many events that the...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
3
by: AlecL | last post by:
Hi All, I am trying to capture the value of a textbox as a result of a button click event in a repeater, but it can't find the textbox. Here is what I am trying to do in the code for the click...
1
by: Øyvind Isaksen | last post by:
I have a Repeater that dynamicly displayes some textboxes. Each Textbox has an ID like this (example): ID="10_20_textbox". The first number (10) describes what article this field is for, and the...
2
by: manishamca | last post by:
can anyone say me how to find the difference of values present in two textbox and display the result in the third textbox. for eg: <input type=text name=t1 value=123> <input...
7
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
i have a master page and aseries of controls labeled fn1, fn2, fn3 , ... i want ot loop and use find control but i'm finding them. i'm using the following w/o luck ContentPlaceHolder cph =...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.