*** StartMail
*** Starts the mail client
#DEFINE HKEY_CLASSES_ROOT -2147483648 && (( HKEY ) 0x80000000 )
#DEFINE HKEY_CURRENT_USER -2147483647 && (( HKEY ) 0x80000001 )
#DEFINE HKEY_LOCAL_MACHINE -2147483646 && (( HKEY ) 0x80000002 )
#DEFINE HKEY_USERS -2147483645 && (( HKEY ) 0x80000003 )
FUNCTION StartMail
LOCAL lcOpenCommand
oControlRegistry1 = CREATEOBJECT("ControlRegistry")
*** Looks for the default email client
lcMailClient = ;
oControlRegistry1.ReadRegistryString(HKEY_LOCAL_MACHINE,;
"Software\Clients\Mail",;
"")
IF EMPTY(lcMailClient)
MSGBOX("No email client installed")
RETURN
ENDIF
DO CASE
CASE lcMailClient = "Exchange"
CASE lcMailClient = "Internet Mail and News"
CASE lcMailClient = "Outlook Express"
CASE lcMailClient = "Microsoft Outlook"
OTHERWISE
Aviso("Unsuported email client")
ENDCASE
*** Gets the command to start the email client
lcString = "Software\Clients\Mail\"+ALLTRIM(lcMailClient)+"\shell\open\command"
lcOpenCommand = ;
oControlRegistry1.ReadRegistryString(HKEY_LOCAL_MACHINE,;
lcString,;
"")
IF EMPTY(lcOpenCommand)
RETURN .F.
ENDIF
ON ERROR DO Nothing
IF !EMPTY(lcOpenCommand)
RUN /N1 &lcOpenCommand
ENDIF
DO ..\Progs\ErrHand.prg
RETURN .T.
ENDFUNC
FUNCTION Nothing
&& Pues eso, nada
ENDFUNC
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only