INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

COM and Automation

How to avoid the security patch check of Outlook XP by mgagnon
Posted: 1 May 02 (Edited 16 Nov 03)

  1. With the suggestions in FAQ184-1768, you will not see the security path from Outlook XP (2002)


  2. There is a fix written by Dmitry Streblechenko (an Outlook MVP) that can be found at this link:

    http://www.dimastr.com/redemption/


  3. A third open was written by Yuri Rubinov:

    *--------------------------
    * YFORCEOL.EXE
    *ForceOl to Work
    *Yuri Rubinov, 2002

    LPARAMETER pcFlFlagNAme

    IF VERSION(2)=0
       _SCREEN.LEFT=-5000
    ENDIF

    LOCAL plFlagFileEndMode
    * File Flag removed or TimeOut
    plFlagFileEndMode = (TYPE("pcFlFlagNAme")="C")
    pnTimeOut=120000 && 2 min

    IF plFlagFileEndMode
       ERASE (pcFlFlagNAme)
       =STRTOFILE(" ",pcFlFlagNAme)
    ENDIF

    PRIVATE oShell, LtimerOL, Starttime

    Starttime=SECONDS()

    oShell = CREATEOBJECT("WScript.Shell")
    LtimerOL=CREATEOBJECT("ForceOL",pnTimeOut,pcFlFlagNAme)

    READ EVENTS

    LtimerOL=.NULL.
    oShell=.NULL.

    RETURN
    *----------------------------------------
    DEFINE CLASS ForceOL AS TIMER
       INTERVAL = 1000
       NAME = "ForceOL"
       timeoutdef = 60000
       FlagName=""
       PROCEDURE INIT
          LPARAMETER pnTimeOut, pcFlFlagNAme
          IF TYPE("pnTimeOut")="N"
             THIS.timeoutdef=pnTimeOut
          ENDIF
          IF TYPE("pcFlFlagNAme")="C"
             THIS.FlagName=pcFlFlagNAme
          ENDIF
       ENDPROC
       PROCEDURE TIMER
          IF oShell.AppActivate("Microsoft Outlook")
             oShell.SendKeys("Y")
          ENDIF
          DO CASE
             CASE SECONDS()-Starttime>=THIS.timeoutdef/1000 CLEAR EVENTS
             CASE NOT EMPTY(THIS.FlagName) AND NOT FILE(THIS.FlagName)
                CLEAR EVENTS
          ENDCASE
       ENDPROC
    ENDDEFINE
    *--------------------------

    *You should RUN THIS PROGRAM AS EXE BEFORE calling email *PROCEDURE IN your PROGRAM.
    DECLARE INTEGER ShellExecute ;
       IN SHELL32.DLL ;
       INTEGER nWinHandle,;
       STRING cOperation,;
       STRING cFileName,;
       STRING cParameters,;
       STRING cDirectory,;
       INTEGER nShowWindow

    lcflag=SYS(5)+CURDIR()+"flag.fff"
    = ShellExecute(0,"open",FULLPATH("yforceol.exe"),lcflag,"",0)
    * send email here


  4. Here is another way, in the style of the "Click Yes" VB application, which makes use of a COM server, API calls, Window scripting (Requires Windows scriptin 5.6 to be installed )and Automation.
    a) Create a empty project (call it security) and in the project create a timer class (Timer2)and set it to OLE Public, making sure that the library is set to main. Create the following methods (Pseudo-Code):

    DEFINE CLASS timer2 AS timer OLEPUBLIC
        Height = 23
        Width = 23
        Interval = 10000
        Name = "timer2"
        PROCEDURE pushbuttons
            PARAMETERS lnHWND
                LOCAL nForeThread, nAppThread
                nForeThread = GetWindowThreadProcessId(GetForegroundWindow(), 0)
                nAppThread = GetCurrentThreadId()
                IF nForeThread != nAppThread
                    AttachThreadInput(nForeThread, nAppThread, .T.)
                    BringWindowToTop(lnHWND)
                    ShowWindow(lnHWND,0)
                    AttachThreadInput(nForeThread, nAppThread, .F.)
                ELSE
                    BringWindowToTop(lnHWND)
                    ShowWindow(lnHWND,0)
                ENDIF
             WshShell = CreateObject("WScript.Shell")
              WshShell.SendKeys("{TAB}")  
              Sleep(1000)
              WshShell.SendKeys("{TAB}")
              Sleep(1000)
              WshShell.SendKeys("{Enter}")
              Sleep(1000)
        ENDPROC
        PROCEDURE Timer
            nHWND = FindWindow(Null,"Microsoft Outlook")
            If nHWND >0
                =THIS.PUSHBUTTONS(nHWND)
            ENDIF
        ENDPROC
        PROCEDURE Init
            DECLARE Sleep IN Win32API INTEGER nMilliseconds
            Declare Long FindWindow In Win32API String, String
            Declare Long BringWindowToTop In Win32API Long

            Declare Long ShowWindow In Win32API Long, Long

            Declare Integer GetCurrentThreadId;
                IN kernel32

            Declare Integer GetWindowThreadProcessId In user32;
                INTEGER   HWnd,;
                INTEGER @ lpdwProcId

            Declare Integer GetCurrentThreadId;
                IN kernel32

            Declare Integer AttachThreadInput In user32 ;
                INTEGER idAttach, ;
                INTEGER idAttachTo, ;
                INTEGER fAttach

            Declare Integer GetForegroundWindow In user32
        ENDPROC


    ENDDEFINE


    b)Once you timer is done compile the project as COM Server. And in a separate program use the following (Which will send any e-mails sitting in your Outlook outbox.:

    oTimer = CREATEOBJECT("security.timer2") && Call the COM server
    oOutlook = Createobject("Outlook.application")
    ns = oOutlook.getnamespace("mapi")
    df = ns.getdefaultfolder(olFolderOutbox)
    nCount = df.items.Count
    For i = nCount To 1 Step -1
        df.items(i).send()
    Endfor



Mike Gagnon
 

 


Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close