Board index » Visual Studio » Registering Events

Registering Events

Visual Studio138
Hi,



How can I register my application to recieve notifications when an event

occurs, e.g. new mail is received. I'm looking for the same functionality

that you get in sounds, where by when an event is fired (e.g. a new email is

recieved) the sound sounds.



Thanks.



--



Regards.


-
 

Re:Registering Events

V3n37,



Your question is really too vague to answer - there is no completely general

event-triggering mechanism in Windows. Do you perhaps mean events raised in

your own application? One way is to use the message mechanism and send

messages to your own application. Another way is to use automation. But, as

stated, you'll have to elaborate a bit on the question.



Johan Rosengren

Abstrakt Mekanik AB



"V3n37" <v3n37@woohoo!.com>a écrit dans le message de

Quote
Hi,



How can I register my application to recieve notifications when an event

occurs, e.g. new mail is received. I'm looking for the same functionality

that you get in sounds, where by when an event is fired (e.g. a new email

is

recieved) the sound sounds.



Thanks.



--



Regards.











-

Re:Registering Events

Hi Johan,



Well your answer kinda explains it. "there is no completely general

event-triggering mechanism in Windows". I thought there was so I could

register an event to it and my application will get a notification (for

example when an e-mail is recieved).



I thought of automating Outlook, however I cannot assume that Outlook will

be used in every machine.



Could you suggest a solution?



--



Regards.





"Johan Rosengren" <johan.rosengren@telia.com>wrote in message

Quote
V3n37,



Your question is really too vague to answer - there is no completely

general

event-triggering mechanism in Windows. Do you perhaps mean events raised

in

your own application? One way is to use the message mechanism and send

messages to your own application. Another way is to use automation. But,

as

stated, you'll have to elaborate a bit on the question.



Johan Rosengren

Abstrakt Mekanik AB



"V3n37" <v3n37@woohoo!.com>a écrit dans le message de

news:O4o696K8DHA.1356@tk2msftngp13.phx.gbl...

>Hi,

>

>How can I register my application to recieve notifications when an event

>occurs, e.g. new mail is received. I'm looking for the same

functionality

>that you get in sounds, where by when an event is fired (e.g. a new

email

is

>recieved) the sound sounds.

>

>Thanks.

>

>--

>

>Regards.

>

>

>









-

Re:Registering Events

V3n37,



I assume you want to do either one of three things: get a notification when

something happens (and emails are just one example of this), get

notifications when a mail app receives a mail, or get notifications when

mails are received.



In the first case, an arbitrary event from some app, you are just out of

luck.



In the second case, an email received by an email app, you would have to

write specific code for a select amount of email-clients, trying to find out

what the user has installed. Note that I, for example, have two different

mail-clients installed, and trying to implement this scheme is probably

possible, but also probably very, very frustrating.



In the third case, you are interested in when an email arrives, and really

don't care about e-mail clients, you might want to skip the mail client

altogether, and talk to the mail server directly.

www.codeguru.com/internet/index.shtml">www.codeguru.com/internet/index.shtml and

www.codeproject.com/internet/">www.codeproject.com/internet/ has lots of code (I

would like to recommend P J Naughter's stuff on CodeProject,

www.codeproject.com/internet/csmtpconn.asp">www.codeproject.com/internet/csmtpconn.asp and/or

www.codeproject.com/internet/cpop3conn.asp)">www.codeproject.com/internet/cpop3conn.asp)



Johan Rosengren

Abstrakt Mekanik AB



"V3n37" <v3n37@woohoo!.com>a écrit dans le message de

Quote
Hi Johan,



Well your answer kinda explains it. "there is no completely general

event-triggering mechanism in Windows". I thought there was so I could

register an event to it and my application will get a notification (for

example when an e-mail is recieved).



I thought of automating Outlook, however I cannot assume that Outlook will

be used in every machine.



Could you suggest a solution?





<snip>





-