|
Window.status can be parsed to understand if the mouse is in somewere area
Piccadilly Yum Yum
|
|
|
|
|
Hi,
I didn't get you. May be I have not explained clearly about my requirement.
I have a requirement where in the mouse events like click and move are obtained through external events. Then I have to use these events and send them to browser object. For this as a part of POC, what I have done is
a) A simple form on which I have AxWebBrowser object to render the content.
b) Another from which will send the mouse events (move or click) along with the position.
c) TCP socket communication to send and receive mouse events.
d) On receiving the events, I will send them to browser object through SendMessage or PostMessage.
Now what I want is, when there is a mouse move event, after sending the event to browser object through SendMessage/PsotMessage, is there any way to find out if the mouse is on a clickable link or object of the content being rendered. I have to use these events to redraw the cursor manually. Do we get any events or way to get this information from the browser object. If yes, please give let me know how to do it in C#.
Any help is appreciated.
|
|
|
|
|
I would use css - take a look at this: CSS Cursors[^]
Regards
Espen Harinn
|
|
|
|
|
create an email application for own website
|
|
|
|
|
OK. Go ahead. We don't mind if you do.
Did you have a question?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
May be he is seeking Code Project's permission...
|
|
|
|
|
|
Here is a VB.Net version I wrote some time ago, you can easily convert to c#.
Imports System
Imports System.Net
Imports System.Net.Mail
Imports System.Net.Mail.MailMessage
Imports System.Net.Mail.SmtpClient
Partial Class contacts
Inherits System.Web.UI.Page
Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick
End Sub
Protected Sub ContactName_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContactName.TextChanged
End Sub
Protected Sub ContactAddress_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContactAddress.TextChanged
End Sub
Protected Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButtonList1.SelectedIndexChanged
End Sub
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Public Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strName As String
Dim strAddress As String
Dim strMessage As String
Dim strType As String
Dim strSendTo As String
Dim strSendFrom As String = "website@address.com"
Dim CompleteMessage As String
strName = ContactName.Text()
strAddress = ContactAddress.Text()
strMessage = TextBox1.Text()
strType = RadioButtonList1.SelectedValue
Select Case strType
Case "sales"
strSendTo = "Person1@address.com"
Case "contractors"
strSendTo = "Person2@Address.com"
Case "general"
strSendTo = "Person3@Address.com"
Case Else
strSendTo = "Person4@Address.com"
End Select
CompleteMessage = "Message From Website " & vbNewLine & strSendFrom & vbNewLine & strSendTo _
& vbNewLine & vbNewLine & strType & vbNewLine & strMessage
Dim mailClient As New SmtpClient()
Dim Message As New MailMessage()
Dim ToEmail As New MailAddress("Person1@address.com", "")
Dim FromEmail As New MailAddress(strSendFrom, "")
'String builder is used for performance reasons whil appending strings
Dim messageBody As New System.Text.StringBuilder()
messageBody.Append("Message Received From Website")
messageBody.AppendLine()
messageBody.Append(strType)
messageBody.AppendLine()
messageBody.Append(strSendFrom)
messageBody.AppendLine()
messageBody.Append(strSendTo)
messageBody.AppendLine()
messageBody.Append(strMessage)
Message.Body = HttpUtility.HtmlDecode(messageBody.ToString)
Message.Subject = strType
'Message is sent in html format
Message.IsBodyHtml = True
Message.To.Add(ToEmail)
Message.From = FromEmail
Try
mailClient.Send(Message)
Catch ex As Exception
End Try
End Sub
End Class
You call it in the ASP page with something like this:
</td>
<td colspan="2" bgcolor="#CCFFCC">
We are happy to hear from you on any matter, so please feel free to make
any comments or ask any questions using this form.<br />
<br />
<asp:TextBox ID="ContactName" runat="server" Width="300px">Your Name</asp:TextBox>
<asp:TextBox ID="ContactAddress" runat="server" Width="300px">Email Address</asp:TextBox>
<br />
<br />
Please indicate what type of contact:<br />
<asp:RadioButtonList ID="RadioButtonList1" runat="server" Width="237px">
<asp:ListItem Value="sales">Sales Enquiry</asp:ListItem>
<asp:ListItem Value="contractors">Contractors Enquiry</asp:ListItem>
<asp:ListItem Value="general">General Enquiry</asp:ListItem>
<asp:ListItem Value="other">Other</asp:ListItem>
</asp:RadioButtonList>
<asp:TextBox ID="TextBox1" runat="server" Height="130px" TextMode="MultiLine"
Width="618px"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Height="36px" Text="Send"
Width="102px" />
</td>
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
This is a very good answer...
|
|
|
|
|
You could up vote it if you like
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
Over my head, Sir; (I upvoted you.)
Help people,so poeple can help you.
|
|
|
|
|
Search on the internet. You will get plenty of examples / samples for download.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
|
Hi guys,
I have the above exception that appears to me when executing my code:
protected void Page_Load (object sender, EventArgs e)
{
if (this.Request ["ActionButton"] == "Generate")
{
string Json = "";
SLSalariesCollection salaries = new SLSalariesCollection (this._Session);
salaries.Init ();
string fileName = @"D:\New Folder\MyXmlff.xml";
if (System.IO.File.Exists (fileName))
{
System.IO.File.Delete (fileName);
}
XmlTextWriter myXmlTextWriter = new XmlTextWriter ("D:/New Folder/MyXmlff.xml",System.Text.Encoding.UTF8);
myXmlTextWriter.Formatting = Formatting.Indented;
myXmlTextWriter.WriteStartDocument(false);
myXmlTextWriter.WriteStartElement("root");
myXmlTextWriter.WriteAttributeString("xmlns","urn:iso:std:iso:20022:tech:xsd:pain.001.001.02");
myXmlTextWriter.WriteStartElement("pain.001.001.02");
int j = 0;
DateTime Now = DateTime.UtcNow;
string datevir = Now.ToString();
Boolean batch = true;
foreach (SLSalarie salari in salaries)
{
j++;
Json = Json + "{succeed : 1}";
myXmlTextWriter.WriteStartElement("Salarié", salari.Matricule);
}
myXmlTextWriter.Flush();
myXmlTextWriter.WriteEndElement();
myXmlTextWriter.WriteEndElement();
myXmlTextWriter.Close();
this.Response.ClearContent();
this.Response.Write(Json);
this.Response.End();
}
the problem that the code is sometimes excuting very well,sometimes no and appear to me this fatal EXCEPTION.
I think that it is problem of refreshing my references.i did this.The first time, ok running very well,the second time EXCEPTION appears.
when doing breakpoints,the problem appears in the collection'initiation.How can I solve that?
also when reading about the class xmltextwriter,i know that i should treat that in my code c#.So do i should to add to my code to solve that?
Thank u very much for u help
hugs
|
|
|
|
|
Where does the exception happen? The message should tell you which line...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Hello,
The exception appears when initiating my collection always:
SLSalariesCollection salariers = new SLSalariesCollection (this._Session);
salariers.Init ();
also xmltextwriter,as I read in msdn it provides also an exception but i don't know how to treat it
ty
|
|
|
|
|
Then either the problem is in the constructor (which you don't show) or in the _Session class variable.
We would need the code for the constructor and / or the variable load.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
hi,
this is the code of my load :
protected override void OnLoad (EventArgs e)
{
try
{
_ApplyCacheStrategy ();
string pageTitle = this.PageTitle;
if (pageTitle != null && (
this.Title == null || this.Title == this.SessionData.PageTitleToOverride))
{
this.Title = pageTitle;
}
_AddCheckServerErrorScript ();
_AddJsReportingScript ();
if (this.RootToken == null)
this.RootToken = _GetRootToken ();
this._PageTask = new WEAppPageTask (this.PageTaskString);
WEAppPageAccess pageAccess;
pageAccess = GetAccess ();
WEAppCheckingAccessResult checkResult = _CheckPageAccess (pageAccess);
pageAccess = GetAccess ();
if (checkResult != WEAppCheckingAccessResult.AUTHORIZED_ACCESS && !_TryChangePageAccess (pageAccess, checkResult))
{
pageAccess = GetAccess ();
_PageAccessDenied (pageAccess, checkResult);
throw new BSCInvalidOperationException ("Method _PageAccessDenied must throws exception or aborts current thread");
}
pageAccess = GetAccess ();
if (pageAccess == null)
throw new BSCInvalidOperationException ("Null access");
if (pageAccess.AccessWeight > -1)
pageAccess.AccessWeight --;
pageAccess.PageAccessState = WEAppPageAccess.GetPageAccessState ();
this.PageAccessState = pageAccess.PageAccessState;
if (pageAccess.PageAccessClean == null)
pageAccess.PageAccessClean = new WEAppPageAccessClean (PageAccessClean);
Thread.CurrentThread.CurrentCulture = this.AppCultureInfo;
base.OnLoad (e);
if (this.BindablePage)
DataBind ();
}
catch (Exception exception)
{throw BSCExceptionPropagation.Throw (exception, MethodBase.GetCurrentMethod (), GetType ());}
}
ty
|
|
|
|
|
That code doesn't set your _Session variable...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."
|
|
|
|
|
Pierre besquent wrote: the problem appears in the collection'initiation
Then show us the collection constructor (and/or maybe its Init method) and show us when you create the _Session object.
|
|
|
|
|
Hi,
I create a class library for my application that contains (_Session).
Tha init method is very good built not have matter.It is seems in xmltextwriter exception
|
|
|
|
|
The problem might be that _Session object is null when you create the collection, so you would be passing a null reference to it, and the null reference exception is thrown into that constructor when you try to access one of the _Session members.
|
|
|
|
|
Make sure this._Session is not null.
This could be throwing the error.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
..and loose the hugging.
I are Troll
|
|
|
|
|
With:
[ when doing breakpoints,the problem appears in the collection'initiation.How can I solve that? ]
I think you meen this part of you code:
[
// Initiation de la collection
SLSalariesCollectio salaries = new SLSalariesCollection (this._Session);
salaries.Init ();
]
Did you check the value of 'this._Session' before initializing your collection?
|
|
|
|