Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*--------------------------
* 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
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
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