Information générale
Catégorie:
Fonctions Windows API
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement