Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Maximizing an iconized exe
Message
De
25/11/2003 09:54:40
 
 
À
25/11/2003 09:02:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00853210
Message ID:
00853279
Vues:
22
>Hello Francesco;
>>
>>I mean an exe called with the "RUN myexe...": I need API statement
>
>All applications on OS. receives a number named HANDLE.. This procedures gets this #HANDLE based on it's Windows captions.. The best deal was if you use some special character on it's title..
>
>
>Declare Sleep IN Win32API;
>    INTEGER dwMilliseconds
>
>Declare INTEGER GetActiveWindow ;
>    IN Win32API
>
>Declare INTEGER GetWindow IN Win32API ;
>    INTEGER HWND, INTEGER nType
>
>Declare INTEGER GetWindowText IN Win32API ;
>    INTEGER HWND, STRING @cText, INTEGER nType
>
>Declare INTEGER BringWindowToTop IN Win32API ;
>    INTEGER HWND
>
>Declare integer SetActiveWindow in user32.dll ;
>    integer hwnd
>
>oShell = CREATEOBJECT("WScript.Shell")
>
>nhandler = 0
>ntetivas = 0
>*
>Do while nhandler = 0 .and. ntetivas < 99
>    nhandler = ais_running("My form caption")
>    ntetivas = ntetivas + 1
>Enddo
>* is running, so activate it
>If  nhandler = 0
>    * application not  running, run it
>Else
>    BringWindowToTop(nhandler)
>    Wait window "Activating windows.. Wait !!" nowait
>    SetActiveWindow(nhandler)
>Endif
>return
>
>Function ais_running
>* check if a given application is running
>Lparameter ctitle
>*
>hnext = GetActiveWindow()
>*
>* iterate through the open windows
>Do WHILE hnext<>0
>    cText = REPLICATE(CHR(0),80)
>    GetWindowText(hnext,@cText,80)         && get window title
>    If  UPPER(ALLTRIM(ctitle)) $ UPPER(cText)
>        *
>        Return hnext
>    Endif
>    hnext = GetWindow(hnext,2)            && next window
>Enddo
>* required window not found
>Return 0
>
>
>
>Claudio
OK Claudio, thank you
Francesco
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform