Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IS_RUN32
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00506776
Message ID:
00507266
Vues:
9
Tim and Benn,

I've just tested the following modification under the conditions you've described. It seems to work fine. Care to test it?
* FUNCTION: Is_Run32.prg

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 ;
  INTEGER hwnd, STRING @lptstr, INTEGER cbmax
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)
    lntext_len = GetWindowText(lnhwnd, @lctitle_bar, 200)
    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
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform