Is Outlook Running?

Is Outlook Running?

Post by Brainard Mille » Thu, 29 Aug 2002 05:14:40



I would like to test if OUTLOOK is running from within VFP6.
If it is not running, I want to start it minimized.
Can anyone help?

--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

 
 
 

Is Outlook Running?

Post by Charly Pruem » Thu, 29 Aug 2002 18:14:48


Hi Brainard,

found this codesample in onother VFP-Usergroup a couple of months ago,
probably it might help you

* FUNCTION: Is_Run32.prg
* AUTHOR: George Tasker
* DATE: January 13, 1998 - 8:26 AM
* PURPOSE: Determines if a Windows
* application is running and returns
* the handle of the window if it is,
* otherwise returns 0. 32 bit version
* for Windows 95/NT 3.51-4
* Modified 5/20/2001 - gt

LPARAMETER pctitle

* Parameter list description
*
* pctitle - The title bar of the Window
*   Note: The title does not have to be
*   the complete title that appears
*
*
* API Declarations
DECLARE INTEGER GetDesktopWindow IN Win32API
DECLARE INTEGER GetWindow IN Win32API;
  INTEGER hwnd, INTEGER dflag
DECLARE INTEGER GetWindowText IN Win32API ;

LOCAL lnhwnd, lnnext, lldone, lctitle_bar, lcsearchfor,;
  lntext_len
lcsearchfor = UPPER(ALLTRIM(pctitle))
lnhwnd = GetDesktopWindow()
lnhwnd = GetWindow(lnhwnd, 5) && Get first child window
lnnext = 2
lldone = .F.
lctitle_bar = ""
DO WHILE NOT lldone
  IF NOT EMPTY(lnhwnd)
    lctitle_bar = SPACE(200) + CHR(0)

    lctitle_bar = UPPER(LEFT(lctitle_bar, lntext_len))
    lldone = (lcsearchfor $ lctitle_bar)
    IF NOT lldone
      lnhwnd = GetWindow(lnhwnd, lnnext)
    ENDIF
  ELSE
    lldone = .T.
  ENDIF
ENDDO
RETURN lnhwnd

-----------------------
Charly
-----------------------



Quote:> I would like to test if OUTLOOK is running from within VFP6.
> If it is not running, I want to start it minimized.
> Can anyone help?

> --
> Posted via Mailgate.ORG Server - http://www.Mailgate.ORG


 
 
 

Is Outlook Running?

Post by Charly Pruem » Thu, 29 Aug 2002 18:24:11


Forgot to mention,

that in the previous code sample if:  lnhwnd returns 0,
you can then start Outlook, because it is not loaded.

Charly



> Hi Brainard,

> found this codesample in onother VFP-Usergroup a couple of months ago,
> probably it might help you

> * FUNCTION: Is_Run32.prg
> * AUTHOR: George Tasker
> * DATE: January 13, 1998 - 8:26 AM
> * PURPOSE: Determines if a Windows
> * application is running and returns
> * the handle of the window if it is,
> * otherwise returns 0. 32 bit version
> * for Windows 95/NT 3.51-4
> * Modified 5/20/2001 - gt

> LPARAMETER pctitle

> * Parameter list description
> *
> * pctitle - The title bar of the Window
> *   Note: The title does not have to be
> *   the complete title that appears
> *
> *
> * API Declarations
> DECLARE INTEGER GetDesktopWindow IN Win32API
> DECLARE INTEGER GetWindow IN Win32API;
>   INTEGER hwnd, INTEGER dflag
> DECLARE INTEGER GetWindowText IN Win32API ;

> LOCAL lnhwnd, lnnext, lldone, lctitle_bar, lcsearchfor,;
>   lntext_len
> lcsearchfor = UPPER(ALLTRIM(pctitle))
> lnhwnd = GetDesktopWindow()
> lnhwnd = GetWindow(lnhwnd, 5) && Get first child window
> lnnext = 2
> lldone = .F.
> lctitle_bar = ""
> DO WHILE NOT lldone
>   IF NOT EMPTY(lnhwnd)
>     lctitle_bar = SPACE(200) + CHR(0)

>     lctitle_bar = UPPER(LEFT(lctitle_bar, lntext_len))
>     lldone = (lcsearchfor $ lctitle_bar)
>     IF NOT lldone
>       lnhwnd = GetWindow(lnhwnd, lnnext)
>     ENDIF
>   ELSE
>     lldone = .T.
>   ENDIF
> ENDDO
> RETURN lnhwnd

> -----------------------
> Charly
> -----------------------



> > I would like to test if OUTLOOK is running from within VFP6.
> > If it is not running, I want to start it minimized.
> > Can anyone help?

> > --
> > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

 
 
 

Is Outlook Running?

Post by Matthias Kahler » Thu, 12 Sep 2002 05:22:01


I think, this will not work, because you need to know the titlebar caption
of Outlook. And for example in Outlook XP the titlebar caption of outlook
changes when you select any folder in Outlook, it will display the caption
"Inbox - Microsoft Outlook". To search that window, you need to know the
active folder.
And: In Outlook XP it is possible to put Outlook into the system tray, so
that it is also no longer visible in the taskbar.

Better way:

Try to create an object of Outlook with CREATEOBJECT(), and then check if it
was successfull:

LOCAL loApp, loMail, lcError
lcError = ON("ERROR")
ON ERROR
loApp = CREATEOBJECT("Outlook.Application")
IF TYPE("loApp") == "O" THEN
    * Successfull
ELSE
    * Error, Outlook not available
ENDIF
ON ERROR &lcError

--
Matthias Kahlert
Software fr den M?belhandel
http://www.max-pro.de



> Forgot to mention,

> that in the previous code sample if:  lnhwnd returns 0,
> you can then start Outlook, because it is not loaded.

> Charly



> > Hi Brainard,

> > found this codesample in onother VFP-Usergroup a couple of months ago,
> > probably it might help you

> > * FUNCTION: Is_Run32.prg
> > * AUTHOR: George Tasker
> > * DATE: January 13, 1998 - 8:26 AM
> > * PURPOSE: Determines if a Windows
> > * application is running and returns
> > * the handle of the window if it is,
> > * otherwise returns 0. 32 bit version
> > * for Windows 95/NT 3.51-4
> > * Modified 5/20/2001 - gt

> > LPARAMETER pctitle

> > * Parameter list description
> > *
> > * pctitle - The title bar of the Window
> > *   Note: The title does not have to be
> > *   the complete title that appears
> > *
> > *
> > * API Declarations
> > DECLARE INTEGER GetDesktopWindow IN Win32API
> > DECLARE INTEGER GetWindow IN Win32API;
> >   INTEGER hwnd, INTEGER dflag
> > DECLARE INTEGER GetWindowText IN Win32API ;

> > LOCAL lnhwnd, lnnext, lldone, lctitle_bar, lcsearchfor,;
> >   lntext_len
> > lcsearchfor = UPPER(ALLTRIM(pctitle))
> > lnhwnd = GetDesktopWindow()
> > lnhwnd = GetWindow(lnhwnd, 5) && Get first child window
> > lnnext = 2
> > lldone = .F.
> > lctitle_bar = ""
> > DO WHILE NOT lldone
> >   IF NOT EMPTY(lnhwnd)
> >     lctitle_bar = SPACE(200) + CHR(0)

> >     lctitle_bar = UPPER(LEFT(lctitle_bar, lntext_len))
> >     lldone = (lcsearchfor $ lctitle_bar)
> >     IF NOT lldone
> >       lnhwnd = GetWindow(lnhwnd, lnnext)
> >     ENDIF
> >   ELSE
> >     lldone = .T.
> >   ENDIF
> > ENDDO
> > RETURN lnhwnd

> > -----------------------
> > Charly
> > -----------------------



> > > I would like to test if OUTLOOK is running from within VFP6.
> > > If it is not running, I want to start it minimized.
> > > Can anyone help?

> > > --
> > > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

 
 
 

1. Connection Failure with Outlook for Win3.1x running

After installing Outlook for Windows 3.1x on a Win for Workgroups maching.
I have been getting Connection Failure SQL State '001000' SQL error:8
(DBNMP3) error when trying to run a VB3 application.  We have SQL6.5 with
SP3 installed.  The App will run if Outlook has not been started.  But if
Outlook has been started and the MAPI mail spooler is running We are getting
the errors.
On some of our machines enabling file and print sharing will correct the
problem (go figure).  But on other machines this will not correct the
problem.
Has anybody else seen this problem?  Please help?

Zack Godwin , MCSE
Data-Tronics Corp.

2. Why did Oracle take away DISTRIBUTED_LOCK_TIMEOUT?

3. can SQLMail run without MS Outlook?

4. FREE EXPLANATION ABOUT THE RULET′S TRICK

5. SQL Mail - must leave Outlook running - Why?

6. Looking for feedback on new tool developed for SQL community.

7. FMP5 running under server, link to Outlook 2K?

8. Application GUI

9. run outlook express ?

10. Help with URL LINKKS WITHIN OUTLOOK and OUTLOOK EXPRESS

11. Using outlook/outlook express in multi-boot system

12. Access report to Outlook/ Open Outlook and mail report

13. ADO and Outlook/Outlook express