|
If I know some X,Y co-ordinates of screen (IE window), when a web page is opened in IE, can we get what HTML Element is there at that specific rect position?
I mean, For example, open http://www.google.co.in/ in IE, that page consists the text like "Web", " Images" etc.,
If I know the rect(X,Y) co-ordinates of "Web", then can we get html tag in which the text belongs(as it is present in <B> tag)?
Similarly If I know the rect(X,Y) co-ordinates of " Images", then can we get html tag in which the text belongs(as it is present in <A> tag)?
How can I do this in c#?
|
|
|
|
|
Hello everybody,
i've got this problem:
I create a new Windows Form (BuyWindow.cs) out of the static class Program.cs which shows me a financial chart. I am using a API from a Data Provider (Taipan Realtime) to create Streams which deliver the actual price information for my security. This Streams I also create in the Program.cs:
private static BuyWindow f;
internal static void testwindow()
{
if (Tapp == null) { Tapp = new TaiPanRTLib.TaiPanRealtime(); }
f.build_chart();
f.Show();
DataStream TPStream;
TPStream = (DataStream)Program.Tapp.DataStream;
TPStream.Add(17956195, 1);
TPStream.Brief += new _IDataStreamEvents_BriefEventHandler(TPStream_BriefBuyWindow);
TPStream.Geld += new _IDataStreamEvents_GeldEventHandler(TPStream_GeldBuyWindow);
}
static void TPStream_GeldBuyWindow(int SymbolNr, float Kurs, float Volume, DateTime Zeit)
{
f.update_bid(Zeit, Kurs, false);
}
static void TPStream_BriefBuyWindow(int SymbolNr, float GeldKurs, float Volume, DateTime Zeit_kurs)
{
f.update_ask(Zeit_kurs, GeldKurs, false);
}
As you can see, I create the Events TPStream_GeldBuyWindow, TPStream_BriefBuyWindow which are triggered every time a new price exists on the Stock Exchange.
In the BuyWindow.cs there is the Code which updates the Form with the respective price(s):
public void update_bid(DateTime bid_time, float price, bool build)
{
if (this.InvokeRequired)
{
this.Invoke(delegateUpdateBid, new object[] { bid_time, price, build });
}
else
{
bidseries1.Points.AddXY(bid_time, price);
if (!build)
{
current_bid = price;
update_label(price.ToString(), "label9");
}
}
}
}
And here's the Problem: The Price is updated just one SINGLE time. That means, the first price after creating the chart and showing the BuyWindow is delivered and shown on the BuyWindow form. But then, the Stream Events in the Program.cs class are never updated again although there are new prices available.
I found out, if I outcomment the f.updatexxx line(s), the Streams work as intended. Every time a new price is settled on the Exchange, the Events are triggered.
So it seems that the Invoke method somehow causes the Program.cs to loose connections with the Stream Events or whatever.
I hope I described the problem good enough Any hints would be appreciated!
|
|
|
|
|
Hi,
your code looks fine to me; you do need a similar InvokeRequired pattern for BuyWindow.update_ask() which you did not show.
I would add some logging to the handlers (maybe a Console.WriteLine would do).
BTW: by convention public identifiers use PascalCase, i.e. they start with a capital (update_ask)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Thank you for the Hint The method update_ask is exactly as implemented as the update_bid method, I just did not show it because of easier reading purpose.
I just moved all the DataStream - respective Code to the BuyWindow.cs, but the Problem still exists.
|
|
|
|
|
Solved!!
I just made DataStream TPStream a Class Variable instead of defining it within a method and now it works!
|
|
|
|
|
Right. I missed that one; your object got collected, giving it some delegates does not keep it alive!
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
how can i invoke start buttons and all the keys using windows application
|
|
|
|
|
SendKeys.Send works for most of the keys.
|
|
|
|
|
what should be given inside the function sendkey.send
how do i invoke the start button
This code was posted by me...
|
|
|
|
|
Ctrl + Esc is the shorcut for start menu. Although I have never tried that throug SendKeys.Send though.
|
|
|
|
|
Just tried, SendKeys.Send("^{ESC}"); appears to work.
|
|
|
|
|
it din work.pls help me
This code was posted by me...
|
|
|
|
|
Well, it works on my machine. So, unless you provide more details on how it doesn't work for you, I'm afraid no one here will be able to help you.
|
|
|
|
|
this is my code
private void page_Load
{
if(condition)
//invoke the start key. i want the menu to pop up just as we click the start menu
SendKeys.Send("^{ESC}");
}
This code was posted by me...
|
|
|
|
|
Wait a moment: page_Load? Just to be sure: are we talking about Window Application or about a Web Application?
If you are trying to send keys through a web application that will newer work, maybe the keys will be sent to the server machine running the site, but I'm not really sure about that.
|
|
|
|
|
I am using C# and have created a regular Windows form. I have used COM and registered AxAcroPDFLib.AxAcroPDF. Here is my code;
axAcroPDF1.LoadFile("myfile.pdf")
axAcroPDF1.Show();
MessageBox.Show("Showing...");
This works fine. But, just like the browser, but PDF file links can't work. I have the full version of Adobe Acrobat installed, Standard 8.0. I also have the Pro. version 7.1.0 on another PC. When I click on link ,Its can't open link URL.
Thank you for any help. please.
|
|
|
|
|
Ignore repost
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
I am using C# and have created a regular Windows form. I have used COM and registered AxAcroPDFLib.AxAcroPDF. Here is my code;
axAcroPDF1.LoadFile("myfile.pdf")
axAcroPDF1.Show();
MessageBox.Show("Showing...");
This works fine. But, just like the browser, but PDF file links can't work. I have the full version of Adobe Acrobat installed, Standard 8.0. I also have the Pro. version 7.1.0 on another PC. When I click on link ,Its can't open link URL.
Thank you for any help. please.
|
|
|
|
|
prakash_adysoft wrote: But, just like the browser, but PDF file links can't work
Your question is not clear buddy
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello...
In VS2003, I can set the version to 1.0.*.*.
The version will be automatically increased, everytime I compile the source code.
But it doesn't work anymore since VS2005. Are there any possibilities to
increase Version automatically ?
Thanks.
|
|
|
|
|
Look at this[^]
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
So far I've managed to do so by EnumDesktopWindows (user32.dll).
But I get all windows regardless whether they can displayed on the taskbar. So I'm using isWindow and isWindowVisible but still I don't get the same results as shows on the taskbar.
My goal is to create a list of running application that currently showing in the taskbar only. No systray apps!!!
My next goal is to get the application Icon and show it (as taskbar does); No idea how to do so. I tried ExtractIcon but did nothing...
Any Idea?
tnx u all...
|
|
|
|
|
Hi,
this is my coding
--------------------------------------------------------------------
while (odr.Read())
{
if (usr.Text == odr["userid"].ToString())
{
MessageBox.Show("User Login", "Information", MessageBoxButtons.OK);
}
else
{
DialogResult drsave = MessageBox.Show("Login Fail", "Erorr", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
if (drsave == DialogResult.OK)
{
usr.Text = "";
pass.Text = "";
usr.Focus();
}
else
this.Close();
}
}
------------------------------------------------------------------------
My program Build Successfully but when i type in textbox any string value my program read every value in my database in give every time message.
for example in my database have 5 records my program read this records in give message 5 time
i want my program check all records in give one message record found or not
please give me solution
thanks in advanc
jawad khatri
i want to
|
|
|
|
|
Hi,
it seems that you want to check if a user exists or not.
I would seperate the presentation (your dialog) from the dataaccess (the select). Try to implement it like this:
private bool DoesUserExists(string sUserID) {
... perform a select statement here with a prepared statement
... then check if you have exactly one record
bool bResult = odr.Read(); --> true if you have one record
... close everything
return b;
}
public void CheckUser() {
... get the value from your textbox
if(this.DoesUserExists(sUserID)) {
} else {
}
}
That would be a better approach than yours. By the way, it doesn't make any sense to check the userid in your database within the code, use the WHERE-clause of SELECT-statements for this.
Hope this helps a bit.
Regards
Sebastian
|
|
|
|