|
you can use progressChanged event (if Progress = -1)
but this event is fired both on stopping navigation and on downloadcompeleted
Houssem.
|
|
|
|
|
Hello
I am wondering if anybody can please help me with the following;
1) How do I attach a signature to a outbound e - mail message using for instance the System.Web.Mail namespace? Should I use another namespace? There does not appear to be a member with which one can accomplish this in the above - mentioned namespace.
Thanking you in advance
ChristiaanS
ChristiaanS
|
|
|
|
|
What do you mean by "add a signature"?? Are you talking about a digital signature that ID's the sender or are you talking about the signature that is at the bottom of an email message, like the signatures at the bottom of most post here on CP??
|
|
|
|
|
|
ChristiaanS wrote: 1) By signature, I meant the signature that you find at the bottom of an e - mail message for instance.
Great. This makes it so much easier...
ChristiaanS wrote: 2) ... I am sure that by the process of elimination I would find an object capable of doing what I need, but as stated previously;
Wrong. There's no such field in an email message. A signature is just a block of text that the email client automatically appends to the body of the message so you don't have to type the signature every time you write an email. You won't find what you're looking for in any email classes.
|
|
|
|
|
If you are talking about signatures that appear at the bottom of every emails (like salutations/advertisements), then that is just more stuff to include in the body of the email message.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
string mySig = "-= Reelix =-";<br />
Mail.Body += "\n\n" + mySig;
-= Reelix =-
|
|
|
|
|
I got a situation an want to solve it if any body have any idea then pleas share it with me. The situation is below
I have two panels panel1 and panel2 in panel1 i have number of buttons and in panel2 i have one list view in which some file are shown.
The thing i want to do when i press any button from panel1 and drag at to panel2 when i drag it any file in pane2 according to the button which i drag some work should have to be done one the file on which i drag the button.
I tried it by many ways but not succeed because when i press my mouse on any button and going drag to list view i can not got Focus of list view and can not get the location on which file the drag is over.
Help me out and thanks in advance.
modified on Tuesday, May 6, 2008 11:27 AM
|
|
|
|
|
It has been awhile since I coded any drag-and-drop events but there are things you must do to have it happen correctly. I believe the issue goes beyond getting focus for your listview.
Panel1 I believe must be set to that you catch the beginning of the drag event.
From the event you can review what object is being chosen and approve or deny it.
If approved you must then put that object (or representative of it) in the clipboard.
Now in Panel2 -or- in your ListView you need to capture the dragover(?) or dragenter(?) event. Basically it is raised any time an item is dragged over it. If you do not catch this event then you will never be allowed to drop anything.
In the event handler you would then interrogate the clipboard to determine if the object type is what you would allow..and if so return the indicator in the event args that you will accept the object.
Finally your drop event either in Panel2 or your ListView (your broken english was readable but not clear as to whether you are dropping in the second panel or your listview). When you get the event, you can then
1) pull the object from the clipboard
2) get out of it the items/files/work you need to get out of it
3) do your population
Hope this helps. I'd suggest you google Coding Drag And Drop to see if you can find more details that can help you solve your problem. You will especially need it when adding the object to the clipboard. I remember havin one object that I could not add and don't remember the attributes that had to be added to make it addable.
|
|
|
|
|
I want to make the mouse move over a button and click without the user touching it. How can I code this?
Thanks in advance.
|
|
|
|
|
You would need to use windows API wrapper
Here is what I did recently
private const UInt32 MOUSEEVENTF_LEFTDOWN = 0x0002;
private const UInt32 MOUSEEVENTF_LEFTUP = 0x0004;
[DllImport("user32.dll")]
private static extern void mouse_event(
UInt32 dwFlags, // motion and click options
UInt32 dx, // horizontal position or change
UInt32 dy, // vertical position or change
UInt32 dwData, // wheel movement
IntPtr dwExtraInfo // application-defined information
);
public static void SendClick(Point location)
{
Point prevPosition = Cursor.Position;
Cursor.Position = location;
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, new System.IntPtr());
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, new System.IntPtr());
Cursor.Position = prevPosition;
}
Roman
|
|
|
|
|
ok thanks ill give it a try.
|
|
|
|
|
Wow!
Just a few changes needed though...
mouse_event(MOUSEEVENTF_LEFTDOWN, Convert.ToUInt32(location.X), Convert.ToUInt32(location.Y), 0, new System.IntPtr());<br />
mouse_event(MOUSEEVENTF_LEFTUP, Convert.ToUInt32(location.X), Convert.ToUInt32(location.Y), 0, new System.IntPtr());
Mightily Impressive though Roman
-= Reelix =-
|
|
|
|
|
hmm interesting, I see that there must be a location of the click?
|
|
|
|
|
That Asian Guy wrote: hmm interesting, I see that there must be a location of the click?
public static void SendClick()
{
Point curPos = Cursor.Position;
mouse_event(MOUSEEVENTF_LEFTDOWN, Convert.ToUInt32(curPos.X), Convert.ToUInt32(curPos.Y), 0, new System.IntPtr());
mouse_event(MOUSEEVENTF_LEFTUP, Convert.ToUInt32(curPos.X), Convert.ToUInt32(curPos.Y), 0, new System.IntPtr());
}
Better?
-= Reelix =-
|
|
|
|
|
Call the mouse Click event in the Mouse hover event
|
|
|
|
|
Hi,
AFAIK you can move the mouse pointer with the Cursor.Position property.
and you can simulate a button click with the Button.PerformClick() method (there is
no need to move the mouse for that to work!)
|
|
|
|
|
Unfortunately it is not a button I want to click (I know, I used it in the question :P, I need to paint automatically in a panel), but thanks anyways. I decided to use a variable which is activated when the bot is activated, and use the mouse_move event instead.
modified on Tuesday, May 6, 2008 4:58 PM
|
|
|
|
|
Hi All,
I have a program that can be started as windows service or as an
windows app.
I need to avoid starting this program as an application if it is
already started as a win service.
In code when program starts as a win service I create named mutex.
Then if user tries to start program as a win application I am checking
if Mutex with the same name exists already and exit program if Mutex
found.
My problem is that Mutex that was created when program started as win
service cannot be found when program starting as a win application.
If I try to run program as a win application twice ( program is not started as a win service at this time) during second attempt Mutex is found.
I would appreciate if anyone can point me how to fix this.
Thanks,
Roman
|
|
|
|
|
Never mind,
I fixed it by using @"Global\MyMutexName" as a mutex name
|
|
|
|
|
Are you running on Vista? Vista runs services on a different session from applications, so that might be your problem. Try prefixing Global\ to your mutex name and see if it works.
|
|
|
|
|
Thanks for response,
I am running Windows XP and I have .NET 3.0 installed. On the box where .NET 3.0 is not installed I can find mutex created in service without using Global\ in mutex name. I think .NET 3.0 is the cause for such behaviour.
Roman
|
|
|
|
|
I've seen a lot of code that looks something like the following:
using (using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
I realize that this ensures that everything will be properly closed and disposed without you having to do anything, but doesn't the same thing happen when the object goes out of scope? Further, what about exception handling? Is that automatically handled as well?
Is it wrong to not want to sue this construct in favor of more obvious code?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John
using is a convenience that hides the following pattern:
FileStream fs = null;
try
{
fs = new FileStream(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
}
finally
{
((IDisposable)fs).Dispose();
} Basically, this guarantees that the Dispose method is called regardless of whether an exception happens or not, thus freeing up unmanaged resources in this case. If a class has a Dispose method, then it should always be called because (presumably) the developers have identified that particular items have to be freed up probably because they are expensive to maintain. The added bonus here is that most implementations of Dispose call GC.SuppressFinalize(...); so the finalizer (if any) is suppressed.
|
|
|
|
|
Pete O'Hanlon wrote: ((IDisposable)fs).Dispose();
Just wondering why this cast ? fs.Dispose() will do it, Right ?
|
|
|
|