Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find Window
Message
 
À
03/04/1998 15:45:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00089413
Message ID:
00090182
Vues:
27
I had some c code that will do this:

// Try to find app window:
nSearchWindows = GetWindow(GetTopWindow(NULL),GW_HWNDFIRST); //Get first in the order
do {
if (GetWindowText(nSearchWindows,cWindowTitle,199) > 0){

if (memcmp("DataTrac",cWindowTitle,8) == 0){ // Found window
lWindowFound = TRUE;
break; // Exit do
}
}
nSearchWindows = GetWindow(nSearchWindows,GW_HWNDNEXT);
} while (nSearchWindows != NULL);

if (lWindowFound == TRUE){ // Found window.
SetForegroundWindow(nSearchWindows); // Set keyboard input to it
break;
}

Basically, it loops through all the windows looking for a window which starts with a string. You can convert it to VFP fairly easily.

--Shawn

>The FindWindowEx API function retrieves the handle of a window whose class name and window name match the specified strings. But I need to find a window with the partial name.
>
>Michel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform